Record Class PlaceholderConditionResult
java.lang.Object
java.lang.Record
com.ordwen.odailyquests.quests.conditions.placeholder.PlaceholderConditionResult
- Record Components:
matched-trueif the condition was satisfiedinvalidFormat-trueif the evaluation failed due to invalid input format
Represents the outcome of evaluating a placeholder condition.
A result may indicate that the condition was successfully matched, that it failed to match, or that it could not be evaluated due to an invalid input format (for example, when parsing a number or a duration fails).
-
Constructor Summary
ConstructorsConstructorDescriptionPlaceholderConditionResult(boolean matched, boolean invalidFormat) Creates an instance of aPlaceholderConditionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static PlaceholderConditionResultCreates a result indicating that the condition was evaluated but did not match.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinvalidFormatrecord component.static PlaceholderConditionResultCreates a result indicating that the condition could not be evaluated because the input values were not in a valid format.booleanmatched()Returns the value of thematchedrecord component.static PlaceholderConditionResultof(boolean matched) Creates either a success or failure result depending on the given flag.static PlaceholderConditionResultCreates a result indicating that the condition was satisfied.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlaceholderConditionResult
public PlaceholderConditionResult(boolean matched, boolean invalidFormat) Creates an instance of aPlaceholderConditionResultrecord class.- Parameters:
matched- the value for thematchedrecord componentinvalidFormat- the value for theinvalidFormatrecord component
-
-
Method Details
-
successResult
Creates a result indicating that the condition was satisfied.- Returns:
- a success result
-
failureResult
Creates a result indicating that the condition was evaluated but did not match.- Returns:
- a failure result
-
invalidFormatResult
Creates a result indicating that the condition could not be evaluated because the input values were not in a valid format.- Returns:
- an invalid format result
-
of
Creates either a success or failure result depending on the given flag.- Parameters:
matched- whether the condition was satisfied- Returns:
- a success result if
matchedis true, otherwise a failure result
-
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 with '=='. -
matched
public boolean matched()Returns the value of thematchedrecord component.- Returns:
- the value of the
matchedrecord component
-
invalidFormat
public boolean invalidFormat()Returns the value of theinvalidFormatrecord component.- Returns:
- the value of the
invalidFormatrecord component
-