Record Class PlaceholderCondition
java.lang.Object
java.lang.Record
com.ordwen.odailyquests.quests.conditions.placeholder.PlaceholderCondition
- Record Components:
placeholder
- the placeholder expression to evaluate (e.g."%player_level%"
)conditionOperator
- the type of condition to check (e.g. equals, greater than, etc.)expectedValue
- the expected value to compare againsterrorMessage
- the message to display if the condition fails (may be null or empty)
public record PlaceholderCondition(String placeholder, ConditionOperator conditionOperator, String expectedValue, String errorMessage)
extends Record
Represents a single placeholder-based condition that can be evaluated
against a player.
A condition defines:
- the placeholder expression to resolve,
- the type of comparison to apply,
- the expected value for comparison,
- and an optional error message to display if the condition fails.
Instances of this record are immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionPlaceholderCondition
(String placeholder, ConditionOperator conditionOperator, String expectedValue, String errorMessage) Creates an instance of aPlaceholderCondition
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconditionOperator
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theerrorMessage
record component.Returns the value of theexpectedValue
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theplaceholder
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
PlaceholderCondition
public PlaceholderCondition(String placeholder, ConditionOperator conditionOperator, String expectedValue, String errorMessage) Creates an instance of aPlaceholderCondition
record class.- Parameters:
placeholder
- the value for theplaceholder
record componentconditionOperator
- the value for theconditionOperator
record componentexpectedValue
- the value for theexpectedValue
record componenterrorMessage
- the value for theerrorMessage
record component
-
-
Method Details
-
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)
. -
placeholder
Returns the value of theplaceholder
record component.- Returns:
- the value of the
placeholder
record component
-
conditionOperator
Returns the value of theconditionOperator
record component.- Returns:
- the value of the
conditionOperator
record component
-
expectedValue
Returns the value of theexpectedValue
record component.- Returns:
- the value of the
expectedValue
record component
-
errorMessage
Returns the value of theerrorMessage
record component.- Returns:
- the value of the
errorMessage
record component
-