Class Json

  • All Implemented Interfaces:
    com.alibaba.fastjson.JSONAware, com.alibaba.fastjson.JSONStreamAware, java.io.Serializable, java.lang.Cloneable, java.lang.reflect.InvocationHandler, java.util.Map<java.lang.String,​java.lang.Object>, Codec
    Direct Known Subclasses:
    ChainProperties, NetworkState

    public class Json
    extends com.alibaba.fastjson.JSONObject
    implements Codec
    Wraps the a JSON structure retrieve via RPC. It extends the standard JS Map with. While it implements a Codec, it is limited in that it can only be used with input objects via RPC, i.e. no hex decoding. Unlike a struct, this waps a JSON object with unknown keys
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      • Fields inherited from class com.alibaba.fastjson.JSON

        DEFAULT_GENERATE_FEATURE, DEFAULT_PARSER_FEATURE, DEFAULT_TYPE_KEY, defaultLocale, defaultTimeZone, DEFFAULT_DATE_FORMAT, VERSION
    • Constructor Summary

      Constructors 
      Constructor Description
      Json​(java.lang.Object value)  
    • Method Summary

      Modifier and Type Method Description
      boolean eq​(java.lang.Object other)
      Compares the value of the input to see if there is a match
      int getEncodedLength()
      Always 0, never encodes as a Uint8Array
      boolean isEmpty()
      Checks if the value is an empty value
      java.lang.String toHex()
      Unimplemented, will throw
      java.lang.Object toJson()
      Converts the Object to JSON, typically used for RPC transfers
      byte[] toU8a​(boolean isBare)
      Unimplemented, will throw
      • Methods inherited from class com.alibaba.fastjson.JSONObject

        clear, clone, containsKey, containsValue, entrySet, equals, fluentClear, fluentPut, fluentPutAll, fluentRemove, get, getBigDecimal, getBigInteger, getBoolean, getBooleanValue, getByte, getBytes, getByteValue, getDate, getDouble, getDoubleValue, getFloat, getFloatValue, getInnerMap, getInteger, getIntValue, getJSONArray, getJSONObject, getLong, getLongValue, getObject, getObject, getObject, getShort, getShortValue, getSqlDate, getString, getTimestamp, hashCode, invoke, keySet, put, putAll, remove, size, values
      • Methods inherited from class com.alibaba.fastjson.JSON

        handleResovleTask, parse, parse, parse, parse, parse, parse, parse, parse, parseArray, parseArray, parseArray, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, setDefaultTypeKey, toJavaObject, toJavaObject, toJavaObject, toJavaObject, toJSON, toJSON, toJSON, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONStringWithDateFormat, toJSONStringZ, toString, writeJSONString, writeJSONString, writeJSONString, writeJSONString, writeJSONString, writeJSONString, writeJSONString, writeJSONStringTo
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.polkadot.types.Codec

        toU8a
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • Json

        public Json​(java.lang.Object value)
    • Method Detail

      • getEncodedLength

        public int getEncodedLength()
        Always 0, never encodes as a Uint8Array
        Specified by:
        getEncodedLength in interface Codec
      • isEmpty

        public boolean isEmpty()
        Checks if the value is an empty value
        Specified by:
        isEmpty in interface Codec
        Specified by:
        isEmpty in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        isEmpty in class com.alibaba.fastjson.JSONObject
      • eq

        public boolean eq​(java.lang.Object other)
        Compares the value of the input to see if there is a match
        Specified by:
        eq in interface Codec
      • toHex

        public java.lang.String toHex()
        Unimplemented, will throw
        Specified by:
        toHex in interface Codec
      • toJson

        public java.lang.Object toJson()
        Converts the Object to JSON, typically used for RPC transfers
        Specified by:
        toJson in interface Codec
      • toU8a

        public byte[] toU8a​(boolean isBare)
        Unimplemented, will throw
        Specified by:
        toU8a in interface Codec