Top Description Fields Constructors Methods
com.google.gson

public final Class JsonNull

extends JsonElement
Class Inheritance

A class representing a JSON null value.
Authors
Inderjeet Singh, Joel Leitch
Since
1.2

Field Summary

Modifier and TypeField and Description
public static final JsonNull
INSTANCE

Singleton for JsonNull.

Constructor Summary

AccessConstructor and Description
public
JsonNull()
Deprecated Deprecated since Gson version 1.8, use INSTANCE instead.

Creates a new JsonNull object.

Method Summary

Modifier and TypeMethod and Description
public JsonNull
deepCopy()

Implements abstract com.google.gson.JsonElement.deepCopy.

Returns the same instance since it is an immutable value.

public boolean
equals(Object other)

Overrides java.lang.Object.equals.

All instances of JsonNull are considered equal.

public int
hashCode()

Overrides java.lang.Object.hashCode.

All instances of JsonNull have the same hash code since they are indistinguishable.

Inherited from com.google.gson.JsonElement:
getAsBigDecimalgetAsBigIntegergetAsBooleangetAsBytegetAsCharactergetAsDoublegetAsFloatgetAsIntgetAsJsonArraygetAsJsonNullgetAsJsonObjectgetAsJsonPrimitivegetAsLonggetAsNumbergetAsShortgetAsStringisJsonArrayisJsonNullisJsonObjectisJsonPrimitivetoString

Field Detail

INSTANCEback to summary
public static final JsonNull INSTANCE

Singleton for JsonNull.

Since
1.8

Constructor Detail

JsonNullback to summary
public JsonNull()

Deprecated

Deprecated since Gson version 1.8, use INSTANCE instead.

Creates a new JsonNull object.

Annotations
@Deprecated

Method Detail

deepCopyback to summary
public JsonNull deepCopy()

Implements abstract com.google.gson.JsonElement.deepCopy.

Returns the same instance since it is an immutable value.

Annotations
@Override
Since
2.8.2
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

All instances of JsonNull are considered equal.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

All instances of JsonNull have the same hash code since they are indistinguishable.

Annotations
@Override