Package ch.tocco.nice2.userbase.api
Record Class PrincipalUpdateData
java.lang.Object
java.lang.Record
ch.tocco.nice2.userbase.api.PrincipalUpdateData
-
Constructor Summary
ConstructorsConstructorDescriptionPrincipalUpdateData(Entity principal, @Nullable Login oldValue, Login newValue) Creates an instance of aPrincipalUpdateDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanReturnstrue, if the username of the current principal changed.final inthashCode()Returns a hash code value for this object.newValue()Returns the value of thenewValuerecord component.@Nullable LoginoldValue()Returns the value of theoldValuerecord component.Returns the value of theprincipalrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PrincipalUpdateData
Creates an instance of aPrincipalUpdateDatarecord class.- Parameters:
principal- the value for theprincipalrecord componentoldValue- the value for theoldValuerecord componentnewValue- the value for thenewValuerecord component
-
-
Method Details
-
hasChangedForCurrentPrincipal
public boolean hasChangedForCurrentPrincipal()Returnstrue, if the username of the current principal changed. That is,oldValueandnewValueare 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 theprincipalrecord component.- Returns:
- the value of the
principalrecord component
-
oldValue
Returns the value of theoldValuerecord component.- Returns:
- the value of the
oldValuerecord component
-
newValue
Returns the value of thenewValuerecord component.- Returns:
- the value of the
newValuerecord component
-