Class Metadata

All Implemented Interfaces:
Serializable, scala.Serializable

public class Metadata extends Object implements scala.Serializable
Metadata is a wrapper over Map[String, Any] that limits the value type to simple ones: Boolean, Long, Double, String, Metadata, Array[Boolean], Array[Long], Array[Double], Array[String], and Array[Metadata]. JSON is used for serialization.

The default constructor is private. User should use either MetadataBuilder or Metadata.fromJson() to create Metadata instances.

param: map an immutable map that stores the data

See Also:
  • Method Details

    • empty

      public static Metadata empty()
      Returns an empty Metadata.
    • fromJson

      public static Metadata fromJson(String json)
      Creates a Metadata instance from JSON.
    • contains

      public boolean contains(String key)
      Tests whether this Metadata contains a binding for a key.
    • getLong

      public long getLong(String key)
      Gets a Long.
    • getDouble

      public double getDouble(String key)
      Gets a Double.
    • getBoolean

      public boolean getBoolean(String key)
      Gets a Boolean.
    • getString

      public String getString(String key)
      Gets a String.
    • getMetadata

      public Metadata getMetadata(String key)
      Gets a Metadata.
    • getLongArray

      public long[] getLongArray(String key)
      Gets a Long array.
    • getDoubleArray

      public double[] getDoubleArray(String key)
      Gets a Double array.
    • getBooleanArray

      public boolean[] getBooleanArray(String key)
      Gets a Boolean array.
    • getStringArray

      public String[] getStringArray(String key)
      Gets a String array.
    • getMetadataArray

      public Metadata[] getMetadataArray(String key)
      Gets a Metadata array.
    • json

      public String json()
      Converts to its JSON representation.
    • toString

      public String toString()
      toString in class Object
    • equals

      public boolean equals(Object obj)
      equals in class Object
    • hashCode

      public int hashCode()
      hashCode in class Object