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 onElementId
s as seeds and returnsElement
s 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 class
GetElements.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 boolean
equals(Object obj)
DirectedType
getDirectedType()
Gets the flag determining whether to return directed, undirected or both types of edges.SeededGraphFilters.IncludeIncomingOutgoingType
getIncludeIncomingOutGoing()
Gets the incomingOutGoingType for this operation which is used for filtering Edges.Iterable<? extends ElementId>
getInput()
Gets theElementId
s that are used to filter the elements.Map<String,String>
getOptions()
com.fasterxml.jackson.core.type.TypeReference<Iterable<? extends Element>>
getOutputTypeReference()
View
getView()
Gets the view of this operation which restricts which elements can be retrieved.int
hashCode()
void
setDirectedType(DirectedType directedType)
Sets the flag determining whether to return directed, undirected or both types of edges.void
setIncludeIncomingOutGoing(SeededGraphFilters.IncludeIncomingOutgoingType inOutType)
Sets the incomingOutGoingType for this operation which is used for filtering Edges.void
setInput(Iterable<? extends ElementId> input)
Sets theElementId
s that are used to filter the elements.void
setOptions(Map<String,String> options)
Set options specific to the store implementation.void
setView(View view)
Sets the view of this operation which restricts which elements can be retrieved.GetElements
shallowClone()
Operation implementations should ensure a ShallowClone method is implemented.String
toString()
-
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:
getIncludeIncomingOutGoing
in interfaceSeededGraphFilters
- Returns:
- includeIncomingOutGoing an
SeededGraphFilters.IncludeIncomingOutgoingType
that controls the incoming/outgoing direction ofEdge
s 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:
setIncludeIncomingOutGoing
in interfaceSeededGraphFilters
- Parameters:
inOutType
- anSeededGraphFilters.IncludeIncomingOutgoingType
that controls the incoming/outgoing direction ofEdge
s 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:
getView
in interfaceOperationView
- Returns:
- view the
View
for 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:
setView
in interfaceOperationView
- Parameters:
view
- theView
for 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:
getDirectedType
in interfaceGraphFilters
- Returns:
- directedType the
DirectedType
which 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:
setDirectedType
in interfaceGraphFilters
- Parameters:
directedType
- theDirectedType
which 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:
getOutputTypeReference
in interfaceOutput<Iterable<? extends Element>>
- Returns:
- the ClosableIterable of Elements type reference
-
getOptions
public Map<String,String> getOptions()
- Specified by:
getOptions
in 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:
setOptions
in 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:Operation
Operation 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:
shallowClone
in interfaceOperation
- Returns:
- shallow clone
-
-