Class HiroVertexMessage

  • All Implemented Interfaces:
    JsonMessage, ToMap, java.io.Serializable

    public class HiroVertexMessage
    extends HiroMessage
    Contains data of a HIRO vertex. Handles string and metaInfo list entries of vertices.
     {
         "attribute1": "value",
         "attribute2": [
              {
                  "value": "value",
                  "created": [epoch ms],
                  "key": "key value"
              }
          ],
         "attribute2": ...
     }
     

    Because the types of attributes can be manifold, they remain stored in the HiroMessage and will be cast to the correct types when reading them with getAttributeAsString(String) or getAttributeAsMetaValue(String).

    See Also:
    Serialized Form
    • Constructor Detail

      • HiroVertexMessage

        public HiroVertexMessage()
        Default constructor for Jackson
      • HiroVertexMessage

        public HiroVertexMessage​(java.util.Map<java.lang.String,​java.lang.Object> initialData)
        Constructor
        Parameters:
        initialData - Initial data for the fieldsMap.
    • Method Detail

      • setField

        public void setField​(java.lang.String key,
                             java.lang.Object value)
        Jackson Setter that transforms incoming lists into MetaValueLists.
        Overrides:
        setField in class HiroMessage
        Parameters:
        key - Incoming JSON key
        value - Incoming JSON value
      • isMetaValueField

        public java.lang.Boolean isMetaValueField​(java.lang.String key)
        Check for a meta value field.
        Parameters:
        key - The key of the field.
        Returns:
        true if the field is a List, false otherwise.
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String key)
        Get an attribute field directly without converting anything.
        Parameters:
        key - The key of the field.
        Returns:
        THe value of the key as Object.
      • getAttributeAsString

        public java.lang.String getAttributeAsString​(java.lang.String key)
        Get an attribute field value.
        Parameters:
        key - The key of the field.
        Returns:
        The value of the field as String. If the value is a MetaValueList, create a csv from all the values.
        See Also:
        getAttribute(String)
      • getAttributeAsMetaValue

        public MetaValueList getAttributeAsMetaValue​(java.lang.String key)
        Get an attribute field as MetaValueField
        Parameters:
        key - The key of the field.
        Returns:
        A MetaValueList. If the value is a String, a list with only one entry with the field 'value' will be returned.
        See Also:
        getAttribute(String)