Class Change<E extends java.lang.Enum & ChangeType,​T>

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public final class Change<E extends java.lang.Enum & ChangeType,​T>
    extends java.lang.Object
    implements java.lang.AutoCloseable

    Class which represents a logical change to a resource. It has an associated type as well as the data that changed.

    Since:
    3.0
    Version:
    3.0
    Author:
    Michael Grove
    See Also:
    ChangeList, ChangeType
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close this change
      boolean equals​(java.lang.Object theObj)
      T getChange()
      Return the change data
      E getChangeType()
      Return the type of change
      int hashCode()
      <C extends java.lang.Enum & ChangeType>
      boolean
      is​(C theType)
      Return whether or not the type of this Change is of the specified type.
      static <E extends java.lang.Enum & ChangeType,​T>
      Change<E,​T>
      of​(E theType, T theChange)
      Create a new Change
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • close

        public void close()
                   throws java.lang.Exception
        Close this change
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception
      • getChangeType

        public E getChangeType()
        Return the type of change
        Returns:
        the change type
      • is

        public <C extends java.lang.Enum & ChangeType> boolean is​(C theType)
        Return whether or not the type of this Change is of the specified type. A convenience method for doing aChange.getType() == SomeChangeType.AType
        Type Parameters:
        C - the type of change to test
        Parameters:
        theType - the change type
        Returns:
        true if this change is of the specified type, false otherwise
      • getChange

        public T getChange()
        Return the change data
        Returns:
        the data
      • of

        public static <E extends java.lang.Enum & ChangeType,​T> Change<E,​T> of​(E theType,
                                                                                           T theChange)
        Create a new Change
        Type Parameters:
        T - the change data type
        E - the change type
        Parameters:
        theType - the type of the change
        theChange - the change data
        Returns:
        A new change
      • equals

        public boolean equals​(java.lang.Object theObj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object