@Override public Object getVertex() { loadIdentifiers(); return entity.getVertex(); }
public Element shallowClone() { final Element element = emptyClone(); element.setProperties(getProperties().clone()); return element; }
@Override public Object getSource() { loadIdentifiers(); return edge.getSource(); }
private Edge cloneCoreFields(final Edge edge) { return new Edge.Builder() .group(edge.getGroup()) .source(edge.getSource()) .dest(edge.getDestination()) .directed(edge.isDirected()) .build(); }
@Override public Edge emptyClone() { return new Edge( getGroup(), getSource(), getDestination(), isDirected(), getMatchedVertex(), new Properties() ); }
@Override public Object getDestination() { loadIdentifiers(); return edge.getDestination(); }
public Object get(final String name) { final Object value; if (loadedProperties.contains(name)) { value = properties.get(name); } else { value = valueLoader.getProperty(name, this); put(name, value); } return value; }
/** * Constructs a by wrapping the provided {@link uk.gov.gchq.gaffer.data.element.Edge} * and using the {@link uk.gov.gchq.gaffer.data.element.ElementValueLoader} to lazily load the element's identifiers and * properties when requested. * * @param edge the edge to wrap. * @param valueLoader the element value loader to use to lazily load the element's identifiers and properties */ public LazyEdge(final Edge edge, final ElementValueLoader valueLoader) { this(edge, valueLoader, new LazyProperties(edge.getProperties(), valueLoader)); }
/** * Constructs a by wrapping the provided {@link uk.gov.gchq.gaffer.data.element.Entity} * and using the {@link uk.gov.gchq.gaffer.data.element.ElementValueLoader} to lazily load the element's identifiers and * properties when requested. * * @param entity the entity to wrap. * @param valueLoader the element value loader to use to lazily load the element's identifiers and properties */ public LazyEntity(final Entity entity, final ElementValueLoader valueLoader) { this(entity, valueLoader, new LazyProperties(entity.getProperties(), valueLoader)); }
@Override public boolean isDirected() { loadIdentifiers(); return edge.isDirected(); }
@Override public void setIdentifiers(final Object source, final Object destination, final boolean directed, final MatchedVertex matchedVertex) { edge.setIdentifiers(source, destination, directed, matchedVertex); identifiersLoaded = true; }
@Override public MatchedVertex getMatchedVertex() { loadIdentifiers(); return edge.getMatchedVertex(); }
protected LazyEntity(final Entity entity, final ElementValueLoader valueLoader, final LazyProperties lazyProperties) { super(entity.getGroup(), null); this.entity = entity; this.valueLoader = valueLoader; this.lazyProperties = lazyProperties; }
@Override public Object getIdentifier(final IdentifierType identifierType) { loadIdentifiers(); return super.getIdentifier(identifierType); }
private void loadIdentifiers() { if (!identifiersLoaded) { valueLoader.loadIdentifiers(entity); identifiersLoaded = true; } } }
@Override public void putIdentifier(final IdentifierType name, final Object value) { entity.putIdentifier(name, value); identifiersLoaded = true; }
@Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType) { edge.setIdentifiers(source, destination, directedType); identifiersLoaded = true; }