Package fr.becpg.repo.activity.data
Record Class DataListStateTransition
java.lang.Object
java.lang.Record
fr.becpg.repo.activity.data.DataListStateTransition
- Record Components:
beforeState- the state of the list before the changeafterState- the state of the list after the change
Change of the validation state of a data list, from one state to another.
A list without any state is to be validated, so a missing or blank state is read as
EntityListState.ToValidate.- Author:
- valentin
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for theafterStaterecord component.private final StringThe field for thebeforeStaterecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDataListStateTransition(String beforeState, String afterState) Creates an instance of aDataListStateTransitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theafterStaterecord component.Returns the value of thebeforeStaterecord component.static Optional<DataListStateTransition> between(Serializable before, Serializable after) Builds the transition between two raw values of the list state property.private static StringeffectiveState(Serializable state) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
beforeState
The field for thebeforeStaterecord component. -
afterState
The field for theafterStaterecord component.
-
-
Constructor Details
-
DataListStateTransition
Creates an instance of aDataListStateTransitionrecord class.- Parameters:
beforeState- the value for thebeforeStaterecord componentafterState- the value for theafterStaterecord component
-
-
Method Details
-
between
Builds the transition between two raw values of the list state property.- Parameters:
before- the property value before the update, possibly nullafter- the property value after the update, possibly null- Returns:
- the transition, or empty when the effective state did not change
-
effectiveState
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
beforeState
Returns the value of thebeforeStaterecord component.- Returns:
- the value of the
beforeStaterecord component
-
afterState
Returns the value of theafterStaterecord component.- Returns:
- the value of the
afterStaterecord component
-