Package uk.gov.gchq.gaffer.data.element
Class LazyEntity
- java.lang.Object
-
- uk.gov.gchq.gaffer.data.element.Element
-
- uk.gov.gchq.gaffer.data.element.Entity
-
- uk.gov.gchq.gaffer.data.element.LazyEntity
-
- All Implemented Interfaces:
Serializable,ElementId,EntityId
public class LazyEntity extends Entity
AnLazyEntitywraps anEntityand lazily loads the identifier and properties when requested using a providedElementValueLoader. This will avoid loading all of an entity's properties just for it to be filtered out by a filter function.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class uk.gov.gchq.gaffer.data.element.Entity
Entity.Builder
-
Nested classes/interfaces inherited from interface uk.gov.gchq.gaffer.data.element.id.ElementId
ElementId.Matches
-
-
Field Summary
-
Fields inherited from class uk.gov.gchq.gaffer.data.element.Element
DEFAULT_GROUP
-
-
Constructor Summary
Constructors Constructor Description LazyEntity(Entity entity, ElementValueLoader valueLoader)Constructs a by wrapping the providedEntityand using theElementValueLoaderto lazily load the element's identifiers and properties when requested.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object element)EntitygetElement()StringgetGroup()LazyPropertiesgetProperties()ObjectgetProperty(String name)ObjectgetVertex()Get the vertex object.inthashCode()voidputIdentifier(IdentifierType name, Object value)voidputProperty(String name, Object value)voidsetVertex(Object vertex)Set the vertex object.-
Methods inherited from class uk.gov.gchq.gaffer.data.element.Entity
emptyClone, equals, getIdentifier, shallowClone, toString
-
Methods inherited from class uk.gov.gchq.gaffer.data.element.Element
copyProperties, removeProperty, shallowEquals, shallowEquals
-
Methods inherited from interface uk.gov.gchq.gaffer.data.element.id.ElementId
getClassName, setClassName
-
-
-
-
Constructor Detail
-
LazyEntity
public LazyEntity(Entity entity, ElementValueLoader valueLoader)
Constructs a by wrapping the providedEntityand using theElementValueLoaderto lazily load the element's identifiers and properties when requested.- Parameters:
entity- the entity to wrap.valueLoader- the element value loader to use to lazily load the element's identifiers and properties
-
-
Method Detail
-
getProperty
public Object getProperty(String name)
- Overrides:
getPropertyin classElement
-
getVertex
public Object getVertex()
Description copied from interface:EntityIdGet the vertex object.
-
setVertex
public void setVertex(Object vertex)
Description copied from interface:EntityIdSet the vertex object.
-
putProperty
public void putProperty(String name, Object value)
- Overrides:
putPropertyin classElement
-
getElement
public Entity getElement()
- Overrides:
getElementin classElement
-
getProperties
public LazyProperties getProperties()
- Overrides:
getPropertiesin classElement
-
putIdentifier
public void putIdentifier(IdentifierType name, Object value)
- Overrides:
putIdentifierin classEntity
-
-