Package com.tnsai.context.decision
Record Class DecisionPolicy.PolicyRule
java.lang.Object
java.lang.Record
com.tnsai.context.decision.DecisionPolicy.PolicyRule
- Enclosing class:
DecisionPolicy
public static record DecisionPolicy.PolicyRule(String id, String description, String category, int priority, boolean mandatory)
extends Record
Represents a policy rule.
-
Constructor Summary
ConstructorsConstructorDescriptionPolicyRule(String id, String description, String category, int priority, boolean mandatory) Creates an instance of aPolicyRulerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncategory()Returns the value of thecategoryrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.booleanReturns the value of themandatoryrecord component.static DecisionPolicy.PolicyRuleCreates a mandatory rule.static DecisionPolicy.PolicyRuleCreates a simple rule.intpriority()Returns the value of thepriorityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PolicyRule
Creates an instance of aPolicyRulerecord class.- Parameters:
id- the value for theidrecord componentdescription- the value for thedescriptionrecord componentcategory- the value for thecategoryrecord componentpriority- the value for thepriorityrecord componentmandatory- the value for themandatoryrecord component
-
-
Method Details
-
of
Creates a simple rule. -
mandatory
Creates a mandatory rule. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
category
Returns the value of thecategoryrecord component.- Returns:
- the value of the
categoryrecord component
-
priority
public int priority()Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-
mandatory
public boolean mandatory()Returns the value of themandatoryrecord component.- Returns:
- the value of the
mandatoryrecord component
-