SemanticsOf (enum)

API

SemanticsOf.java
enum SemanticsOf {
  SAFE_AND_REQUEST_CACHEABLE     (1)
  SAFE     (2)
  IDEMPOTENT     (3)
  NON_IDEMPOTENT     (4)
  IDEMPOTENT_ARE_YOU_SURE     (5)
  NON_IDEMPOTENT_ARE_YOU_SURE     (6)
  NOT_SPECIFIED     (7)
  String getFriendlyName()
  String getCamelCaseName()
  boolean isIdempotentInNature()     (8)
  boolean isSafeInNature()     (9)
  boolean isSafeAndRequestCacheable()
  boolean isAreYouSure()
  boolean isIdempotentOrCachable()
}
1 SAFE_AND_REQUEST_CACHEABLE

Safe, with no side effects, and caching the returned value when invoked multiple times in the same request.

2 SAFE

Safe, with no side-effects. In other words, a query-only action.

3 IDEMPOTENT

Post-conditions are always the same, irrespective as to how many times called.

4 NON_IDEMPOTENT

Neither safe nor idempotent; every invocation is likely to change the state of the object.

5 IDEMPOTENT_ARE_YOU_SURE

Post-conditions are always the same, irrespective as to how many times called.

6 NON_IDEMPOTENT_ARE_YOU_SURE

Neither safe nor idempotent; every invocation is likely to change the state of the object.

7 NOT_SPECIFIED

Ignore the value provided by this annotation (meaning that the framework will keep searching, in meta annotations or superclasses/interfaces).

8 isIdempotentInNature()

Any of #SAFE , #SAFE_AND_REQUEST_CACHEABLE or (obviously) #IDEMPOTENT .

9 isSafeInNature()

Either of #SAFE or #SAFE_AND_REQUEST_CACHEABLE .

Members

SAFE_AND_REQUEST_CACHEABLE

Safe, with no side effects, and caching the returned value when invoked multiple times in the same request.

  • Changes state: No

  • HTTP verb: GET

  • Effect of multiple calls: Will always return the same result each time invoked (within a given request scope).

SAFE

Safe, with no side-effects. In other words, a query-only action.

  • Changes state: No

  • HTTP verb: GET

  • Effect of multiple calls: Might result in different results each invocation (within a given request scope).

IDEMPOTENT

Post-conditions are always the same, irrespective as to how many times called.

  • Changes state: Yes

  • HTTP verb: PUT

  • Effect of multiple calls: Will make no further changes if called multiple times (eg sets a property or adds of same item to a Set).

NON_IDEMPOTENT

Neither safe nor idempotent; every invocation is likely to change the state of the object.

  • Changes state: Yes

  • HTTP verb: POST

  • Effect of multiple calls: Might change the state of the system each time called (eg increments a counter or adds to a List).

  • Example: Increasing the quantity of a line item in an Order by 1.

IDEMPOTENT_ARE_YOU_SURE

Post-conditions are always the same, irrespective as to how many times called.

If supported the UI viewer will show a confirmation dialog before executing the action.

  • Changes state: Yes

  • HTTP verb: PUT

  • Effect of multiple calls: Will make no further changes if called multiple times (eg sets a property or adds of same item to a Set).

NON_IDEMPOTENT_ARE_YOU_SURE

Neither safe nor idempotent; every invocation is likely to change the state of the object.

If supported the UI viewer will show a confirmation dialog before executing the action.

  • Changes state: Yes

  • HTTP verb: POST

  • Effect of multiple calls: Might change the state of the system each time called (eg increments a counter or adds to a List).

  • Example: Increasing the quantity of a line item in an Order by 1.

NOT_SPECIFIED

Ignore the value provided by this annotation (meaning that the framework will keep searching, in meta annotations or superclasses/interfaces).

isIdempotentInNature()

Any of #SAFE , #SAFE_AND_REQUEST_CACHEABLE or (obviously) #IDEMPOTENT .

isSafeInNature()

Either of #SAFE or #SAFE_AND_REQUEST_CACHEABLE .