Package ch.tocco.nice2.userbase.api
Record Class PrincipalUpdateData
java.lang.Object
java.lang.Record
ch.tocco.nice2.userbase.api.PrincipalUpdateData
-
Constructor Summary
ConstructorDescriptionPrincipalUpdateData
(Entity principal, Login oldValue, Login newValue) Creates an instance of aPrincipalUpdateData
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.boolean
Returnstrue
, if the username of the current principal changed.final int
hashCode()
Returns a hash code value for this object.newValue()
Returns the value of thenewValue
record component.oldValue()
Returns the value of theoldValue
record component.Returns the value of theprincipal
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
PrincipalUpdateData
Creates an instance of aPrincipalUpdateData
record class.- Parameters:
principal
- the value for theprincipal
record componentoldValue
- the value for theoldValue
record componentnewValue
- the value for thenewValue
record component
-
-
Method Details
-
hasChangedForCurrentPrincipal
public boolean hasChangedForCurrentPrincipal()Returnstrue
, if the username of the current principal changed. That is,oldValue
andnewValue
are not equal and the key of the current principal equals the old principal. -
getOldValue
-
getNewValue
-
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)
. -
principal
Returns the value of theprincipal
record component.- Returns:
- the value of the
principal
record component
-
oldValue
Returns the value of theoldValue
record component.- Returns:
- the value of the
oldValue
record component
-
newValue
Returns the value of thenewValue
record component.- Returns:
- the value of the
newValue
record component
-