Package com.complexible.common.base
Class Change<E extends Enum & ChangeType,T>
java.lang.Object
com.complexible.common.base.Change<E,T>
- All Implemented Interfaces:
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:
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this changebooleanReturn the change dataReturn the type of changeinthashCode()<C extends Enum & ChangeType>
booleanis(C theType) Return whether or not the type of this Change is of the specified type.static <E extends Enum & ChangeType,T>
Change<E, T> of(E theType, T theChange) Create a new ChangetoString()
-
Method Details
-
close
Close this change- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getChangeType
Return the type of change- Returns:
- the change type
-
is
Return whether or not the type of this Change is of the specified type. A convenience method for doingaChange.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
Return the change data- Returns:
- the data
-
of
Create a new Change- Type Parameters:
E- the change typeT- the change data type- Parameters:
theType- the type of the changetheChange- the change data- Returns:
- A new change
-
equals
-
hashCode
public int hashCode() -
toString
-