org.cruxframework.crux.core.shared.rest.annotation
Enum StateValidationModel

java.lang.Object
  extended by java.lang.Enum<StateValidationModel>
      extended by org.cruxframework.crux.core.shared.rest.annotation.StateValidationModel
All Implemented Interfaces:
Serializable, Comparable<StateValidationModel>

public enum StateValidationModel
extends Enum<StateValidationModel>

Indicates if Crux must validate previous state of resources being updated.

Author:
Thiago da Rosa de Bustamante

Enum Constant Summary
ENSURE_STATE_MATCHES
          PUT operation will be executed only if the client retains the current state for the resource.
NO_VALIDATE
          Disable the state validation for the PUT operation.
VALIDATE_IF_PRESENT
          If the target resource was previously loaded and the client retain some state for this resource, Crux will ensure that the PUT operation will be executed only if this state matches the current state of the resource
 
Method Summary
static StateValidationModel valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StateValidationModel[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NO_VALIDATE

public static final StateValidationModel NO_VALIDATE
Disable the state validation for the PUT operation.


VALIDATE_IF_PRESENT

public static final StateValidationModel VALIDATE_IF_PRESENT
If the target resource was previously loaded and the client retain some state for this resource, Crux will ensure that the PUT operation will be executed only if this state matches the current state of the resource


ENSURE_STATE_MATCHES

public static final StateValidationModel ENSURE_STATE_MATCHES
PUT operation will be executed only if the client retains the current state for the resource. If the resource was not previously loaded by a GET operation, the method will fail.

Method Detail

values

public static StateValidationModel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (StateValidationModel c : StateValidationModel.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static StateValidationModel valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2015. All rights reserved.