Class MapGenerator
- java.lang.Object
-
- uk.gov.gchq.gaffer.data.generator.MapGenerator
-
- All Implemented Interfaces:
Function<Iterable<? extends Element>,Iterable<? extends Map<String,Object>>>,ObjectGenerator<Map<String,Object>>,OneToOneObjectGenerator<Map<String,Object>>
public class MapGenerator extends Object implements OneToOneObjectGenerator<Map<String,Object>>
AMapGeneratoris a generator which creates a representation of anElementusing aLinkedHashMap.For example, providing an
Edgewith fields:- Group: "EdgeGroup"
- Source: "A"
- Destination: "B"
- Directed: true
- Property1: "propValue"
LinkedHashMap, for which the fields will be represented as:
{ GROUP: "EdgeGroup", SOURCE: "A", DESTINATION: "B", DIRECTED: "true" PROPERTY1: "propValue" }Any constants relevant to a particular
Elementcan be added, and will be stored in a separateLinkedHashMap.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMapGenerator.Builder
-
Constructor Summary
Constructors Constructor Description MapGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>_apply(Element element)LinkedHashMap<String,String>getConstants()LinkedHashMap<String,String>getFields()voidsetConstants(LinkedHashMap<String,String> constants)voidsetFields(LinkedHashMap<String,String> fields)-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.gov.gchq.gaffer.data.generator.OneToOneObjectGenerator
apply
-
-
-
-
Field Detail
-
GROUP
public static final String GROUP
- See Also:
- Constant Field Values
-
-
Method Detail
-
_apply
public Map<String,Object> _apply(Element element)
- Specified by:
_applyin interfaceOneToOneObjectGenerator<Map<String,Object>>- Parameters:
element- the element to convert- Returns:
- the generated domain object
-
getFields
public LinkedHashMap<String,String> getFields()
-
setFields
public void setFields(LinkedHashMap<String,String> fields)
-
getConstants
public LinkedHashMap<String,String> getConstants()
-
setConstants
public void setConstants(LinkedHashMap<String,String> constants)
-
-