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
AnLazyEntity
wraps anEntity
and 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 providedEntity
and using theElementValueLoader
to lazily load the element's identifiers and properties when requested.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object element)
Entity
getElement()
String
getGroup()
LazyProperties
getProperties()
Object
getProperty(String name)
Object
getVertex()
Get the vertex object.int
hashCode()
void
putIdentifier(IdentifierType name, Object value)
void
putProperty(String name, Object value)
void
setVertex(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 providedEntity
and using theElementValueLoader
to 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:
getProperty
in classElement
-
getVertex
public Object getVertex()
Description copied from interface:EntityId
Get the vertex object.
-
setVertex
public void setVertex(Object vertex)
Description copied from interface:EntityId
Set the vertex object.
-
putProperty
public void putProperty(String name, Object value)
- Overrides:
putProperty
in classElement
-
getElement
public Entity getElement()
- Overrides:
getElement
in classElement
-
getProperties
public LazyProperties getProperties()
- Overrides:
getProperties
in classElement
-
putIdentifier
public void putIdentifier(IdentifierType name, Object value)
- Overrides:
putIdentifier
in classEntity
-
-