Record Class McpProgressToken
java.lang.Object
java.lang.Record
com.soklet.McpProgressToken
Immutable wrapper for MCP progress tokens.
- Author:
- Mark Allen
-
Constructor Summary
ConstructorsConstructorDescriptionMcpProgressToken(@NonNull McpValue value) Creates an instance of aMcpProgressTokenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasNumber()Reads the progress token as a number when it is number-backed.asString()Reads the progress token as a string when it is string-backed.final booleanIndicates whether some other object is "equal to" this one.static @NonNull McpProgressTokenfromNumber(@NonNull BigDecimal value) Creates a number-backed progress token.static @NonNull McpProgressTokenfromString(@NonNull String value) Creates a string-backed progress token.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
McpProgressToken
Creates an instance of aMcpProgressTokenrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
fromString
Creates a string-backed progress token.- Parameters:
value- the string progress token- Returns:
- the progress token wrapper
-
fromNumber
Creates a number-backed progress token.- Parameters:
value- the numeric progress token- Returns:
- the progress token wrapper
-
asString
-
asNumber
Reads the progress token as a number when it is number-backed.- Returns:
- the numeric progress token, if this wrapper holds one
-
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). -
value
-