Package eliasstar.jsonrpc.objects.id
Class NullId
- java.lang.Object
-
- eliasstar.jsonrpc.objects.id.NullId
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
EveryNullId
is equal.Object
get()
Getter fornull
.int
hashCode()
The hash code is always zero because there is only one instance ofNullId
.static NullId
instance()
Getter for singleton instance.String
toString()
Gets the literal string"null"
.void
write(com.google.gson.stream.JsonWriter out)
Writes a null literal to out.
-
-
-
Method Detail
-
instance
public static NullId instance()
Getter for singleton instance.The instance is lazyly instanciated, which means the the singleton instance is created when this method is invoked for the first time. Any consecutive calls return the instance.
- Returns:
- The only instance of
NullId
-
get
public Object get()
Getter fornull
.
-
write
public void write(com.google.gson.stream.JsonWriter out) throws IOException
Writes a null literal to out.- Specified by:
write
in interfaceId<Object>
- Parameters:
out
- TheJsonWriter
used as output- Throws:
IOException
- If serialization fails
-
hashCode
public int hashCode()
The hash code is always zero because there is only one instance ofNullId
.
-
-