Class JsonEventObjectBase

java.lang.Object
com.espertech.esper.common.internal.event.json.core.JsonEventObjectBase
All Implemented Interfaces:
JsonEventObject, Map<String,Object>

public abstract class JsonEventObjectBase extends Object implements JsonEventObject
  • Field Details

  • Constructor Details

    • JsonEventObjectBase

      public JsonEventObjectBase()
  • Method Details

    • addJsonValue

      public abstract void addJsonValue(String name, Object value)
      Add a dynamic property value that the json parser encounters. Dynamic property values are not predefined and are catch-all in nature.
      Parameters:
      name - name
      value - value
    • getJsonValues

      public abstract Map<String,Object> getJsonValues()
      Returns the dynamic property values (the non-predefined values)
      Returns:
      map
    • getNativeSize

      public abstract int getNativeSize()
      Returns the total number of pre-declared properties available including properties of the parent event type if any
      Returns:
      size
    • getNativeEntry

      public abstract Map.Entry<String,Object> getNativeEntry(int num)
      Returns the name-value pre-declared property including properties of the parent event type if any
      Parameters:
      num - index number of the property
      Returns:
      entry
      Throws:
      NoSuchElementException - for invalid index
    • getNativeKey

      public abstract String getNativeKey(int num)
      Returns the pre-declared property name including properties names of the parent event type if any
      Parameters:
      num - index number of the property
      Returns:
      name
      Throws:
      NoSuchElementException - for invalid index
    • getNativeValue

      public abstract Object getNativeValue(int num)
      Returns the value of a pre-declared property including property values of the parent event type if any
      Parameters:
      num - index number of the property
      Returns:
      value
      Throws:
      NoSuchElementException - for invalid index
    • getNativeNum

      public abstract int getNativeNum(String name)
      Returns the index number of a a pre-declared property of the same name including property names of the parent event type if any
      Parameters:
      name - property name
      Returns:
      index starting at zero, ending at native-size minus 1; Returns -1 for non-existing property name
    • nativeContainsKey

      public abstract boolean nativeContainsKey(Object key)
      Returns the flag whether the key exists as a pre-declared property of the same name including property names of the parent event type if any
      Parameters:
      key - property name
      Returns:
      flag
    • nativeWrite

      public abstract void nativeWrite(JsonWriter writer) throws IOException
      Write the pre-declared properties to the writer
      Parameters:
      writer - writer
      Throws:
      IOException - for IO exceptions
    • writeTo

      public void writeTo(Writer writer, WriterConfig config) throws IOException
      Description copied from interface: JsonEventObject
      Write JSON to the provided writer and using the provided configuration.
      Specified by:
      writeTo in interface JsonEventObject
      Parameters:
      writer - writer
      config - JSON writer settings
      Throws:
      IOException - when an IO exception occurs
    • write

      public void write(JsonWriter writer) throws IOException
      Throws:
      IOException
    • size

      public int size()
      Specified by:
      size in interface Map<String,Object>
    • entrySet

      public Set<Map.Entry<String,Object>> entrySet()
      Specified by:
      entrySet in interface Map<String,Object>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<String,Object>
    • keySet

      public Set<String> keySet()
      Specified by:
      keySet in interface Map<String,Object>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<String,Object>
    • get

      public Object get(Object key)
      Specified by:
      get in interface Map<String,Object>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<String,Object>
    • values

      public Collection<Object> values()
      Specified by:
      values in interface Map<String,Object>
    • put

      public Object put(String key, Object value)
      Specified by:
      put in interface Map<String,Object>
    • remove

      public Object remove(Object key)
      Specified by:
      remove in interface Map<String,Object>
    • putAll

      public void putAll(Map<? extends String,?> m)
      Specified by:
      putAll in interface Map<String,Object>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<String,Object>
    • remove

      public boolean remove(Object key, Object value)
      Specified by:
      remove in interface Map<String,Object>
    • replaceAll

      public void replaceAll(BiFunction<? super String,? super Object,?> function)
      Specified by:
      replaceAll in interface Map<String,Object>
    • putIfAbsent

      public Object putIfAbsent(String key, Object value)
      Specified by:
      putIfAbsent in interface Map<String,Object>
    • replace

      public boolean replace(String key, Object oldValue, Object newValue)
      Specified by:
      replace in interface Map<String,Object>
    • replace

      public Object replace(String key, Object value)
      Specified by:
      replace in interface Map<String,Object>
    • toString

      public String toString(WriterConfig config)
      Description copied from interface: JsonEventObject
      Returns the JSON string given a writer configuration
      Specified by:
      toString in interface JsonEventObject
      Parameters:
      config - JSON writer settings
      Returns:
      JSON
    • toString

      public String toString()
      Description copied from interface: JsonEventObject
      Returns the JSON string using WriterConfig.MINIMAL.
      Specified by:
      toString in interface JsonEventObject
      Overrides:
      toString in class Object
      Returns:
      JSON