Package org.consensusj.jsonrpc.cli
Record Class CliParameter.Valid
java.lang.Object
java.lang.Record
org.consensusj.jsonrpc.cli.CliParameter.Valid
- Record Components:
source
- source JSON stringobject
- parsed object
- All Implemented Interfaces:
CliParameter
- Enclosing interface:
CliParameter
public static record CliParameter.Valid(String source, Object object)
extends Record
implements CliParameter
Implementation for Valid objects
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.consensusj.jsonrpc.cli.CliParameter
CliParameter.Invalid, CliParameter.Parser, CliParameter.Valid
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.object()
Returns the value of theobject
record component.source()
Returns the value of thesource
record component.stream()
Stream zero or 1 valid objects.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.consensusj.jsonrpc.cli.CliParameter
invalid, valid
-
Constructor Details
-
Method Details
-
stream
Description copied from interface:CliParameter
Stream zero or 1 valid objects.This allows
.flatMap(CliParameter::stream)
to filter invalid and unwrap valid objects.- Specified by:
stream
in interfaceCliParameter
- Returns:
- A stream of zero or one valid objects.
-
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
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)
. -
source
Returns the value of thesource
record component.- Specified by:
source
in interfaceCliParameter
- Returns:
- the value of the
source
record component
-
object
Returns the value of theobject
record component.- Returns:
- the value of the
object
record component
-