Class PropertiesRecord


  • public class PropertiesRecord
    extends Record
    A basic record containing a list of name,value pairs
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertiesRecord()
      Construct a record with a default ID
      PropertiesRecord​(java.lang.String id)
      Create a PropertiesRecord with a specific ID
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addProperty​(java.lang.String name, java.lang.String value)
      Add a name,value pair to the record
      java.util.Map<java.lang.String,​java.lang.String> getProperties()
      Return a list of properties in this record
      java.lang.String getProperty​(java.lang.String name)
      Return the value of the property stored in this record
      Record parse​(com.google.gson.JsonObject jsonObj)
      Create the record from JSON.
      com.google.gson.JsonObject toJSON()
      Returns the record in JSON format.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • PropertiesRecord

        public PropertiesRecord()
        Construct a record with a default ID
      • PropertiesRecord

        public PropertiesRecord​(java.lang.String id)
        Create a PropertiesRecord with a specific ID
        Parameters:
        id - the record id
    • Method Detail

      • addProperty

        public void addProperty​(java.lang.String name,
                                java.lang.String value)
        Add a name,value pair to the record
        Parameters:
        name - name of the property
        value - value of the property
      • getProperty

        public java.lang.String getProperty​(java.lang.String name)
        Return the value of the property stored in this record
        Parameters:
        name - the name of the property to be retrieved
        Returns:
        the value of the property
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Return a list of properties in this record
        Returns:
        the list of properties in this record
      • toJSON

        public com.google.gson.JsonObject toJSON()
        Returns the record in JSON format.
        Overrides:
        toJSON in class Record
        Returns:
        the JSON format of this record.
      • parse

        public Record parse​(com.google.gson.JsonObject jsonObj)
        Create the record from JSON.
        Overrides:
        parse in class Record
        Parameters:
        jsonObj - The object in JSON to be parsed.
        Returns:
        the record representing by the supplied JSON contents.