Record Class TypeParseResult<T>
java.lang.Object
java.lang.Record
dev.ua.theroer.magicutils.commands.TypeParseResult<T>
- Type Parameters:
T- parsed value type- Record Components:
status- parse statusvalue- parsed value
Detailed result for command argument parsing.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTypeParseResult(@NotNull TypeParseResult.Status status, T value) Creates an instance of aTypeParseResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static <T> TypeParseResult<T> invalid()Creates an invalid-value result.booleanReturns true when the input was provided but invalid.booleanReturns true when the input was not provided.booleanReturns true when parsing succeeded.static <T> TypeParseResult<T> missing()Creates a missing-value result.@NotNull TypeParseResult.Statusstatus()Returns the value of thestatusrecord component.static <T> TypeParseResult<T> success(T value) Creates a successful parse result.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Method Details
-
success
Creates a successful parse result.- Type Parameters:
T- value type- Parameters:
value- parsed value- Returns:
- success result
-
missing
Creates a missing-value result.- Type Parameters:
T- value type- Returns:
- missing result
-
invalid
Creates an invalid-value result.- Type Parameters:
T- value type- Returns:
- invalid result
-
isSuccess
public boolean isSuccess()Returns true when parsing succeeded.- Returns:
- success flag
-
isMissing
public boolean isMissing()Returns true when the input was not provided.- Returns:
- missing flag
-
isInvalid
public boolean isInvalid()Returns true when the input was provided but invalid.- Returns:
- invalid flag
-
toString
-
hashCode
-
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). -
status
-
value
-