Class HiroVertexMessage
- java.lang.Object
-
- co.arago.hiro.client.model.HiroJsonMap
-
- co.arago.hiro.client.model.HiroMessage
-
- co.arago.hiro.client.model.vertex.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)orgetAttributeAsMetaValue(String).- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class co.arago.hiro.client.model.HiroMessage
hiroError
-
Fields inherited from class co.arago.hiro.client.model.HiroJsonMap
fieldsMap
-
-
Constructor Summary
Constructors Constructor Description HiroVertexMessage()Default constructor for JacksonHiroVertexMessage(java.util.Map<java.lang.String,java.lang.Object> initialData)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetAttribute(java.lang.String key)Get an attribute field directly without converting anything.MetaValueListgetAttributeAsMetaValue(java.lang.String key)Get an attribute field as MetaValueFieldjava.lang.StringgetAttributeAsString(java.lang.String key)Get an attribute field value.java.lang.BooleanisMetaValueField(java.lang.String key)Check for a meta value field.voidsetField(java.lang.String key, java.lang.Object value)Jackson Setter that transforms incoming lists into MetaValueLists.-
Methods inherited from class co.arago.hiro.client.model.HiroMessage
catchError, getError, isError
-
Methods inherited from class co.arago.hiro.client.model.HiroJsonMap
addFields, getField, getMap, getUnmappedField, setFields, toMap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface co.arago.hiro.client.model.JsonMessage
toJsonString, toJsonStringNoNull, toPrettyJsonString, toPrettyJsonStringNoNull
-
-
-
-
Method Detail
-
setField
public void setField(java.lang.String key, java.lang.Object value)Jackson Setter that transforms incoming lists into MetaValueLists.- Overrides:
setFieldin classHiroMessage- Parameters:
key- Incoming JSON keyvalue- 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)
-
-