Class JsonValueBase

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    JsonArray, JsonNull, JsonObject, JsonValue

    public abstract class JsonValueBase
    extends java.lang.Object
    implements java.io.Serializable
    An abstract class which acts as the base class for all JSON based types in NCache.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected JsonValueBase()
      Default constructor
      protected JsonValueBase​(java.lang.Object value, JsonDataType dataType)
      Overloaded constructor which cass the value to JSONDataType provided
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JsonDataType getDataType()
      Gets the type of the json object.
      protected int getInMemorySize()  
      protected int getSize()  
      java.lang.Object getValue()
      Gets the value of the json object.
      static JsonValueBase parse​(java.lang.String json)
      Parses string representation of json object and returns the parsed object.
      java.lang.String toJson()
      Gets the string representation of the JsonValueBase.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonValueBase

        protected JsonValueBase()
        Default constructor
      • JsonValueBase

        protected JsonValueBase​(java.lang.Object value,
                                JsonDataType dataType)
        Overloaded constructor which cass the value to JSONDataType provided
        Parameters:
        value -
        dataType -
    • Method Detail

      • getSize

        protected int getSize()
      • getInMemorySize

        protected int getInMemorySize()
      • getDataType

        public JsonDataType getDataType()
        Gets the type of the json object.
        Returns:
        The type of the json object.
      • getValue

        public java.lang.Object getValue()
        Gets the value of the json object.
        Returns:
        The value of the json object.
      • parse

        public static JsonValueBase parse​(java.lang.String json)
        Parses string representation of json object and returns the parsed object.
        Parameters:
        json - The json string.
        Returns:
        The parsed JsonValueBase object.
      • toJson

        public java.lang.String toJson()
        Gets the string representation of the JsonValueBase.
        Returns:
        The string representation of the JsonValueBase.