Record Class PlaceholderConditionResult
java.lang.Object
java.lang.Record
com.ordwen.odailyquests.quests.conditions.placeholder.PlaceholderConditionResult
- Record Components:
matched
-true
if the condition was satisfiedinvalidFormat
-true
if 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 aPlaceholderConditionResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static PlaceholderConditionResult
Creates a result indicating that the condition was evaluated but did not match.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of theinvalidFormat
record component.static PlaceholderConditionResult
Creates a result indicating that the condition could not be evaluated because the input values were not in a valid format.boolean
matched()
Returns the value of thematched
record component.static PlaceholderConditionResult
of
(boolean matched) Creates either a success or failure result depending on the given flag.static PlaceholderConditionResult
Creates a result indicating that the condition was satisfied.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
PlaceholderConditionResult
public PlaceholderConditionResult(boolean matched, boolean invalidFormat) Creates an instance of aPlaceholderConditionResult
record class.- Parameters:
matched
- the value for thematched
record componentinvalidFormat
- the value for theinvalidFormat
record 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
matched
is 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 thematched
record component.- Returns:
- the value of the
matched
record component
-
invalidFormat
public boolean invalidFormat()Returns the value of theinvalidFormat
record component.- Returns:
- the value of the
invalidFormat
record component
-