Enum Class 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>, java.lang.constant.Constable
Enclosing class:
ResourceEvent

public static enum ResourceEvent.Type extends Enum<ResourceEvent.Type>
Possible type of resource events.
  • Enum Constant Details

    • 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 Details

    • values

      public static ResourceEvent.Type[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ResourceEvent.Type valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • valueOfId

      public static ResourceEvent.Type valueOfId(int id)
      Convenient method to get an instance given its id.
      Parameters:
      id - given constant id.
      Returns:
      corresponding instance if any.
      Throws:
      IllegalArgumentException - if id does not correspond to any constant.
    • getId

      public int getId()
      Gets the constant id. Implementations may use this id, along with valueOfId(int), for optimal storing purposes.
      Returns:
      constant id.
    • of

      public ResourceEvent of(ResourceSeed resourceSeed)
      Constructs a ResourceEvent 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 a ResourceEvent of this type for the specified resource and event time. This method is mostly used by a store implementation when de-serializing a ResourceEvent instance. Clients reporting events captured by listeners in the application are rather advised to use the of(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 corresponding ChangeEvent class.
      Returns:
      corresponding ChangeEvent class.