Enum ModifiedState
- java.lang.Object
-
- java.lang.Enum<ModifiedState>
-
- io.github.astrapi69.collection.modification.ModifiedState
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ModifiedState>
public enum ModifiedState extends java.lang.Enum<ModifiedState>
The Enum ModifiedState represents states if a collection have been modified. Checks the same( or different) collection in different states. If a reference of a collection in the past is same or modified with the reference of the collection now.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CLEARED
The cleared state.FIRST_MATCH
The first match state.NEW_MATCH
The new match state.REMOVED
The removed state.UNMODIFIED
The unmodified state.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ModifiedState
isModified(java.util.Collection<T> previous, java.util.Collection<T> next)
Checks if the given previous(for instance in the past) Collection is modified comparing the next(for instance now) Collection.static ModifiedState
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ModifiedState[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CLEARED
public static final ModifiedState CLEARED
The cleared state. This indicates that no entry exists anymore in the collection.
-
FIRST_MATCH
public static final ModifiedState FIRST_MATCH
The first match state. This indicates that there is a total new match. Precondition is that no entries exists in the collection.
-
NEW_MATCH
public static final ModifiedState NEW_MATCH
The new match state. This indicates that an new entry is added. Precondition is that entries exists in the collection.
-
REMOVED
public static final ModifiedState REMOVED
The removed state. This indicates that an entry has been removed. Precondition is that minimun an entry exists in the collection.
-
UNMODIFIED
public static final ModifiedState UNMODIFIED
The unmodified state. This indicates that no entry added or removed from the collection.
-
-
Method Detail
-
values
public static ModifiedState[] 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 (ModifiedState c : ModifiedState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ModifiedState valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
isModified
public static <T> ModifiedState isModified(java.util.Collection<T> previous, java.util.Collection<T> next)
Checks if the given previous(for instance in the past) Collection is modified comparing the next(for instance now) Collection.- Type Parameters:
T
- the type.- Parameters:
previous
- the previous collection.next
- the next collection.- Returns:
- the modified
-
-