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 booleanequals(Object obj)EveryNullIdis equal.Objectget()Getter fornull.inthashCode()The hash code is always zero because there is only one instance ofNullId.static NullIdinstance()Getter for singleton instance.StringtoString()Gets the literal string"null".voidwrite(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 IOExceptionWrites a null literal to out.- Specified by:
writein interfaceId<Object>- Parameters:
out- TheJsonWriterused as output- Throws:
IOException- If serialization fails
-
hashCode
public int hashCode()
The hash code is always zero because there is only one instance ofNullId.
-
-