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 aPlaceholderConditionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconditionOperatorrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorMessagerecord component.Returns the value of theexpectedValuerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theplaceholderrecord component.final StringtoString()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 aPlaceholderConditionrecord class.- Parameters:
placeholder- the value for theplaceholderrecord componentconditionOperator- the value for theconditionOperatorrecord componentexpectedValue- the value for theexpectedValuerecord componenterrorMessage- the value for theerrorMessagerecord 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 theplaceholderrecord component.- Returns:
- the value of the
placeholderrecord component
-
conditionOperator
Returns the value of theconditionOperatorrecord component.- Returns:
- the value of the
conditionOperatorrecord component
-
expectedValue
Returns the value of theexpectedValuerecord component.- Returns:
- the value of the
expectedValuerecord component
-
errorMessage
Returns the value of theerrorMessagerecord component.- Returns:
- the value of the
errorMessagerecord component
-