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 ofNumberconcreteBigDecimal.- 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 booleanequals(Object obj)TwoNumberIdobjects are equal if their underlying id is equal.BigDecimalget()Getter for the actual id.inthashCode()Returns the hash code for thisNumberId.StringtoString()Returns the string representation for thisNumberId.voidwrite(com.google.gson.stream.JsonWriter out)Writes aNumberto 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:
getin interfaceSupplier<BigDecimal>- Returns:
- The actual id
-
write
public void write(com.google.gson.stream.JsonWriter out) throws IOExceptionWrites aNumberto out.- Specified by:
writein interfaceId<BigDecimal>- Parameters:
out- TheJsonWriterused as output- Throws:
IOException- If serialization fails
-
hashCode
public int hashCode()
Returns the hash code for thisNumberId.
-
equals
public boolean equals(Object obj)
TwoNumberIdobjects are equal if their underlying id is equal.
-
-