Enum ResourceEvent.Type

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