Package org.ametys.core.right
Record Class AccessExplanation
java.lang.Object
java.lang.Record
org.ametys.core.right.AccessExplanation
- Record Components:
accessControllerId
- the controller idaccessResult
- the access resultexplanation
- The explanation as aI18nizableText
- All Implemented Interfaces:
Comparable<AccessExplanation>
public record AccessExplanation(String accessControllerId, AccessController.AccessResult accessResult, I18nizableText explanation)
extends Record
implements Comparable<AccessExplanation>
Explanation of an
AccessController.AccessResult
provided by an AccessController
-
Constructor Summary
ConstructorDescriptionAccessExplanation
(String accessControllerId, AccessController.AccessResult accessResult, I18nizableText explanation) Creates an instance of aAccessExplanation
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccessControllerId
record component.Returns the value of theaccessResult
record component.int
static I18nizableText
elementsToI18nizableText
(List<String> elements) Helper to build aI18nizableText
for a list of Stringfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of theexplanation
record component.static I18nizableText
groupsToI18nizableText
(Set<Group> groups) Helper to build aI18nizableText
for groupsfinal int
hashCode()
Returns a hash code value for this object.static I18nizableText
profilesToI18nizableText
(Set<Profile> profiles) Helper to build aI18nizableText
for profilesfinal String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
AccessExplanation
public AccessExplanation(String accessControllerId, AccessController.AccessResult accessResult, I18nizableText explanation) Creates an instance of aAccessExplanation
record class.- Parameters:
accessControllerId
- the value for theaccessControllerId
record componentaccessResult
- the value for theaccessResult
record componentexplanation
- the value for theexplanation
record component
-
-
Method Details
-
profilesToI18nizableText
Helper to build aI18nizableText
for profiles- Parameters:
profiles
- the profile- Returns:
- the
I18nizableText
-
groupsToI18nizableText
Helper to build aI18nizableText
for groups- Parameters:
groups
- the profile- Returns:
- the
I18nizableText
-
elementsToI18nizableText
Helper to build aI18nizableText
for a list of String- Parameters:
elements
- the strings- Returns:
- the
I18nizableText
-
compareTo
- Specified by:
compareTo
in interfaceComparable<AccessExplanation>
-
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
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)
. -
accessControllerId
Returns the value of theaccessControllerId
record component.- Returns:
- the value of the
accessControllerId
record component
-
accessResult
Returns the value of theaccessResult
record component.- Returns:
- the value of the
accessResult
record component
-
explanation
Returns the value of theexplanation
record component.- Returns:
- the value of the
explanation
record component
-