Package com.sodius.oslc.server.trs.model
Enum ResourceEvent.Type
- java.lang.Object
-
- java.lang.Enum<ResourceEvent.Type>
-
- com.sodius.oslc.server.trs.model.ResourceEvent.Type
-
- All Implemented Interfaces:
Serializable
,Comparable<ResourceEvent.Type>
- Enclosing class:
- ResourceEvent
public static enum ResourceEvent.Type extends Enum<ResourceEvent.Type>
Possible type of resource events.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Class<? extends ChangeEvent>
getChangeEventClass()
Convenient method to know the correspondingChangeEvent
class.int
getId()
Gets the constant id.ResourceEvent
of(ResourceSeed resourceSeed)
Constructs aResourceEvent
of this type for the specified resource and current time.ResourceEvent
of(ResourceSeed resourceSeed, Date time)
Constructs aResourceEvent
of this type for the specified resource and event time.static ResourceEvent.Type
valueOf(String name)
Returns the enum constant of this type with the specified name.static ResourceEvent.Type
valueOfId(int id)
Convenient method to get an instance given itsid
.static ResourceEvent.Type[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CREATED
public static final ResourceEvent.Type CREATED
Denotes the creation of the referenced resource.
-
MODIFIED
public static final ResourceEvent.Type MODIFIED
Denotes a modification to the referenced resource.
-
DELETED
public static final ResourceEvent.Type DELETED
Denotes the elimination of the referenced resource.
-
-
Method Detail
-
values
public static ResourceEvent.Type[] 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 (ResourceEvent.Type c : ResourceEvent.Type.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ResourceEvent.Type 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 nameNullPointerException
- if the argument is null
-
valueOfId
public static ResourceEvent.Type valueOfId(int id)
Convenient method to get an instance given itsid
.- Parameters:
id
- given constant id.- Returns:
- corresponding instance if any.
- Throws:
IllegalArgumentException
- ifid
does not correspond to any constant.
-
getId
public int getId()
Gets the constant id. Implementations may use this id, along withvalueOfId(int)
, for optimal storing purposes.- Returns:
- constant id.
-
of
public ResourceEvent of(ResourceSeed resourceSeed)
Constructs aResourceEvent
of this type for the specified resource and current time. Clients are advised to use this method for reporting events captured by listeners in the application.- Parameters:
resourceSeed
- the event resource's seed. This is the minimal information that later enables to recompute the URI of the resource.- Returns:
- the corresponding
ResourceEvent
instance.
-
of
public ResourceEvent of(ResourceSeed resourceSeed, Date time)
Constructs aResourceEvent
of this type for the specified resource and event time. This method is mostly used by a store implementation when de-serializing aResourceEvent
instance. Clients reporting events captured by listeners in the application are rather advised to use theof(ResourceSeed)
method.- Parameters:
resourceSeed
- the event resource's seed. This is the minimal information that later enables to recompute the URI of the resource.time
- the event time.- Returns:
- the corresponding
ResourceEvent
instance.
-
getChangeEventClass
public abstract Class<? extends ChangeEvent> getChangeEventClass()
Convenient method to know the correspondingChangeEvent
class.- Returns:
- corresponding
ChangeEvent
class.
-
-