Package org.consensusj.jsonrpc.cli
Record Class CliParameter.Invalid
java.lang.Object
java.lang.Record
org.consensusj.jsonrpc.cli.CliParameter.Invalid
- Record Components:
source
- source JSON stringerror
- parsing exception
- All Implemented Interfaces:
CliParameter
- Enclosing interface:
CliParameter
public static record CliParameter.Invalid(String source, Exception error)
extends Record
implements CliParameter
Implementation for Invalid source strings
-
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.error()
Returns the value of theerror
record component.final int
hashCode()
Returns a hash code value for this object.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
-
error
Returns the value of theerror
record component.- Returns:
- the value of the
error
record component
-