Package eliasstar.jsonrpc.objects.id
Class NumberId
- java.lang.Object
-
- eliasstar.jsonrpc.objects.id.NumberId
-
- All Implemented Interfaces:
Id<BigDecimal>
,Supplier<BigDecimal>
public final class NumberId extends Object implements Id<BigDecimal>
Represents an id with a type ofNumber
concreteBigDecimal
.- Since:
- 0.1.0
- Author:
- Elias*
- See Also:
- JSON-RPC Specification
-
-
Constructor Summary
Constructors Constructor Description NumberId(BigDecimal id)
Creates aNumberId
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
TwoNumberId
objects are equal if their underlying id is equal.BigDecimal
get()
Getter for the actual id.int
hashCode()
Returns the hash code for thisNumberId
.String
toString()
Returns the string representation for thisNumberId
.void
write(com.google.gson.stream.JsonWriter out)
Writes aNumber
to out.
-
-
-
Constructor Detail
-
NumberId
public NumberId(BigDecimal id)
Creates aNumberId
.- Parameters:
id
- The id to be used
-
-
Method Detail
-
get
public BigDecimal get()
Getter for the actual id.- Specified by:
get
in interfaceSupplier<BigDecimal>
- Returns:
- The actual id
-
write
public void write(com.google.gson.stream.JsonWriter out) throws IOException
Writes aNumber
to out.- Specified by:
write
in interfaceId<BigDecimal>
- Parameters:
out
- TheJsonWriter
used as output- Throws:
IOException
- If serialization fails
-
hashCode
public int hashCode()
Returns the hash code for thisNumberId
.
-
equals
public boolean equals(Object obj)
TwoNumberId
objects are equal if their underlying id is equal.
-
-