Class GetElements
- java.lang.Object
-
- uk.gov.gchq.gaffer.operation.impl.get.GetElements
-
- All Implemented Interfaces:
Closeable,AutoCloseable,GraphFilters,OperationView,SeededGraphFilters,Input<Iterable<? extends ElementId>>,InputOutput<Iterable<? extends ElementId>,Iterable<? extends Element>>,MultiElementIdInput,MultiInput<ElementId>,Output<Iterable<? extends Element>>,Operation
public class GetElements extends Object implements InputOutput<Iterable<? extends ElementId>,Iterable<? extends Element>>, MultiElementIdInput, SeededGraphFilters
Gets elements from Gaffer based onElementIds as seeds and returnsElements There are various flags to filter out the elements returned: Equal will only return Elements with identifiers that match the seed exactly. Related will return:- Entities when their vertex matches vertex of a EntityId
- Entities when their vertex matches the source or destination of a EdgeId
- Edges when their source, destination and directed type matches the EdgeId
- Edges when their source, destination matches the EdgeId where the DirectedType of the EdgeId is
DirectedType.EITHER - Edges when their source or destination match the EntityId's vertex
IncludeIncomingOutgoingType.INCOMING- only returns edges where the destination matches the vertex of EntityIdIncludeIncomingOutgoingType.OUTGOING- only returns edges where the source matches the vertex of EntityIdIncludeIncomingOutgoingType.EITHER- returns all edges regardless of their direction
DirectedType.DIRECTED- only return directed edgesDirectedType.UNDIRECTED- only return undirected edgesDirectedType.EITHER- return both directed or undirected edges
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGetElements.Builder-
Nested classes/interfaces inherited from interface uk.gov.gchq.gaffer.operation.Operation
Operation.BaseBuilder<OP extends Operation,B extends Operation.BaseBuilder<OP,?>>
-
Nested classes/interfaces inherited from interface uk.gov.gchq.gaffer.operation.graph.SeededGraphFilters
SeededGraphFilters.IncludeIncomingOutgoingType
-
-
Constructor Summary
Constructors Constructor Description GetElements()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)DirectedTypegetDirectedType()Gets the flag determining whether to return directed, undirected or both types of edges.SeededGraphFilters.IncludeIncomingOutgoingTypegetIncludeIncomingOutGoing()Gets the incomingOutGoingType for this operation which is used for filtering Edges.Iterable<? extends ElementId>getInput()Gets theElementIds that are used to filter the elements.Map<String,String>getOptions()com.fasterxml.jackson.core.type.TypeReference<Iterable<? extends Element>>getOutputTypeReference()ViewgetView()Gets the view of this operation which restricts which elements can be retrieved.inthashCode()voidsetDirectedType(DirectedType directedType)Sets the flag determining whether to return directed, undirected or both types of edges.voidsetIncludeIncomingOutGoing(SeededGraphFilters.IncludeIncomingOutgoingType inOutType)Sets the incomingOutGoingType for this operation which is used for filtering Edges.voidsetInput(Iterable<? extends ElementId> input)Sets theElementIds that are used to filter the elements.voidsetOptions(Map<String,String> options)Set options specific to the store implementation.voidsetView(View view)Sets the view of this operation which restricts which elements can be retrieved.GetElementsshallowClone()Operation implementations should ensure a ShallowClone method is implemented.StringtoString()-
Methods inherited from interface uk.gov.gchq.gaffer.operation.graph.GraphFilters
validate, validateFlags
-
Methods inherited from interface uk.gov.gchq.gaffer.operation.io.MultiElementIdInput
createInputArray, setInput, setInputFromVerticesAndIds
-
Methods inherited from interface uk.gov.gchq.gaffer.operation.Operation
_getNullOrOptions, addOption, containsOption, getOption, getOption, validate, validateRequiredFieldPresent
-
Methods inherited from interface uk.gov.gchq.gaffer.operation.graph.OperationView
setViews, validate, validate, validatePostAggregationFilter, validatePostTransformFilter, validatePreAggregationFilter
-
Methods inherited from interface uk.gov.gchq.gaffer.operation.io.Output
castToOutputType, getOutputClass, getOutputType
-
-
-
-
Method Detail
-
getIncludeIncomingOutGoing
public SeededGraphFilters.IncludeIncomingOutgoingType getIncludeIncomingOutGoing()
Gets the incomingOutGoingType for this operation which is used for filtering Edges.- Specified by:
getIncludeIncomingOutGoingin interfaceSeededGraphFilters- Returns:
- includeIncomingOutGoing an
SeededGraphFilters.IncludeIncomingOutgoingTypethat controls the incoming/outgoing direction ofEdges that are filtered out in the operation. - See Also:
SeededGraphFilters.IncludeIncomingOutgoingType
-
setIncludeIncomingOutGoing
public void setIncludeIncomingOutGoing(SeededGraphFilters.IncludeIncomingOutgoingType inOutType)
Sets the incomingOutGoingType for this operation which is used for filtering Edges.- Specified by:
setIncludeIncomingOutGoingin interfaceSeededGraphFilters- Parameters:
inOutType- anSeededGraphFilters.IncludeIncomingOutgoingTypethat controls the incoming/outgoing direction ofEdges that are filtered out in the operation.- See Also:
SeededGraphFilters.IncludeIncomingOutgoingType
-
getView
public View getView()
Gets the view of this operation which restricts which elements can be retrieved.- Specified by:
getViewin interfaceOperationView- Returns:
- view the
Viewfor the operation. - See Also:
View
-
setView
public void setView(View view)
Sets the view of this operation which restricts which elements can be retrieved.- Specified by:
setViewin interfaceOperationView- Parameters:
view- theViewfor the operation.- See Also:
View
-
getDirectedType
public DirectedType getDirectedType()
Gets the flag determining whether to return directed, undirected or both types of edges.- Specified by:
getDirectedTypein interfaceGraphFilters- Returns:
- directedType the
DirectedTypewhich relates to whether the edges are directed, undirected or either - See Also:
DirectedType
-
setDirectedType
public void setDirectedType(DirectedType directedType)
Sets the flag determining whether to return directed, undirected or both types of edges.- Specified by:
setDirectedTypein interfaceGraphFilters- Parameters:
directedType- theDirectedTypewhich relates to whether the edges are directed, undirected or either- See Also:
DirectedType
-
getOutputTypeReference
public com.fasterxml.jackson.core.type.TypeReference<Iterable<? extends Element>> getOutputTypeReference()
- Specified by:
getOutputTypeReferencein interfaceOutput<Iterable<? extends Element>>- Returns:
- the ClosableIterable of Elements type reference
-
getOptions
public Map<String,String> getOptions()
- Specified by:
getOptionsin interfaceOperation- Returns:
- the operation options. This may contain store specific options such as authorisation strings or and other properties required for the operation to be executed. Note these options will probably not be interpreted in the same way by every store implementation.
-
setOptions
public void setOptions(Map<String,String> options)
Set options specific to the store implementation.- Specified by:
setOptionsin interfaceOperation- Parameters:
options- the operation options. This may contain store specific options such as authorisation strings or and other properties required for the operation to be executed. Note these options will probably not be interpreted
-
shallowClone
public GetElements shallowClone()
Description copied from interface:OperationOperation implementations should ensure a ShallowClone method is implemented. Performs a shallow clone. Creates a new instance and copies the fields across. It does not clone the fields. If the operation contains nested operations, these must also be cloned.- Specified by:
shallowClonein interfaceOperation- Returns:
- shallow clone
-
-