protected Iterable<Property> internalGetProperties(String key, String name) { getFetchHints().assertPropertyIncluded(name); return new FilterIterable<Property>(getProperties()) { @Override protected boolean isIncluded(Property property) { if (key != null && !property.getKey().equals(key)) { return false; } return property.getName().equals(name); } }; }
protected Iterable<Property> internalGetProperties(String key, String name) { getFetchHints().assertPropertyIncluded(name); return new FilterIterable<Property>(getProperties()) { @Override protected boolean isIncluded(Property property) { if (key != null && !property.getKey().equals(key)) { return false; } return property.getName().equals(name); } }; }
@Override public Iterable<Property> getProperties(final String key, final String name) { if (ID_PROPERTY_NAME.equals(name)) { ArrayList<Property> result = new ArrayList<>(); result.add(getIdProperty()); return result; } else if (Edge.LABEL_PROPERTY_NAME.equals(name) && this instanceof Edge) { ArrayList<Property> result = new ArrayList<>(); result.add(getEdgeLabelProperty()); return result; } else if (Edge.OUT_VERTEX_ID_PROPERTY_NAME.equals(name) && this instanceof Edge) { ArrayList<Property> result = new ArrayList<>(); result.add(getOutVertexIdProperty()); return result; } else if (Edge.IN_VERTEX_ID_PROPERTY_NAME.equals(name) && this instanceof Edge) { ArrayList<Property> result = new ArrayList<>(); result.add(getInVertexIdProperty()); return result; } else if (Edge.IN_OR_OUT_VERTEX_ID_PROPERTY_NAME.equals(name) && this instanceof Edge) { ArrayList<Property> result = new ArrayList<>(); result.add(getInOrOutVertexIdProperty()); return result; } getFetchHints().assertPropertyIncluded(name); return internalGetProperties(key, name); }
@Override public Iterable<Property> getProperties(final String key, final String name) { if (ID_PROPERTY_NAME.equals(name)) { ArrayList<Property> result = new ArrayList<>(); result.add(getIdProperty()); return result; } else if (Edge.LABEL_PROPERTY_NAME.equals(name) && this instanceof Edge) { ArrayList<Property> result = new ArrayList<>(); result.add(getEdgeLabelProperty()); return result; } else if (Edge.OUT_VERTEX_ID_PROPERTY_NAME.equals(name) && this instanceof Edge) { ArrayList<Property> result = new ArrayList<>(); result.add(getOutVertexIdProperty()); return result; } else if (Edge.IN_VERTEX_ID_PROPERTY_NAME.equals(name) && this instanceof Edge) { ArrayList<Property> result = new ArrayList<>(); result.add(getInVertexIdProperty()); return result; } else if (Edge.IN_OR_OUT_VERTEX_ID_PROPERTY_NAME.equals(name) && this instanceof Edge) { ArrayList<Property> result = new ArrayList<>(); result.add(getInOrOutVertexIdProperty()); return result; } getFetchHints().assertPropertyIncluded(name); return internalGetProperties(key, name); }
protected Property getIdProperty() { if (idProperty == null) { idProperty = new MutablePropertyImpl( ElementMutation.DEFAULT_KEY, ID_PROPERTY_NAME, getId(), null, getTimestamp(), null, null, getFetchHints() ); } return idProperty; }
protected Property getIdProperty() { if (idProperty == null) { idProperty = new MutablePropertyImpl( ElementMutation.DEFAULT_KEY, ID_PROPERTY_NAME, getId(), null, getTimestamp(), null, null, getFetchHints() ); } return idProperty; }
protected Property getOutVertexIdProperty() { if (outVertexIdProperty == null && this instanceof Edge) { String outVertexId = ((Edge) this).getVertexId(Direction.OUT); outVertexIdProperty = new MutablePropertyImpl( ElementMutation.DEFAULT_KEY, Edge.OUT_VERTEX_ID_PROPERTY_NAME, outVertexId, null, getTimestamp(), null, null, getFetchHints() ); } return outVertexIdProperty; }
protected Property getEdgeLabelProperty() { if (edgeLabelProperty == null && this instanceof Edge) { String edgeLabel = ((Edge) this).getLabel(); edgeLabelProperty = new MutablePropertyImpl( ElementMutation.DEFAULT_KEY, Edge.LABEL_PROPERTY_NAME, edgeLabel, null, getTimestamp(), null, null, getFetchHints() ); } return edgeLabelProperty; }
protected Property getEdgeLabelProperty() { if (edgeLabelProperty == null && this instanceof Edge) { String edgeLabel = ((Edge) this).getLabel(); edgeLabelProperty = new MutablePropertyImpl( ElementMutation.DEFAULT_KEY, Edge.LABEL_PROPERTY_NAME, edgeLabel, null, getTimestamp(), null, null, getFetchHints() ); } return edgeLabelProperty; }
protected Property getInVertexIdProperty() { if (inVertexIdProperty == null && this instanceof Edge) { String inVertexId = ((Edge) this).getVertexId(Direction.IN); inVertexIdProperty = new MutablePropertyImpl( ElementMutation.DEFAULT_KEY, Edge.IN_VERTEX_ID_PROPERTY_NAME, inVertexId, null, getTimestamp(), null, null, getFetchHints() ); } return inVertexIdProperty; }
protected Property getOutVertexIdProperty() { if (outVertexIdProperty == null && this instanceof Edge) { String outVertexId = ((Edge) this).getVertexId(Direction.OUT); outVertexIdProperty = new MutablePropertyImpl( ElementMutation.DEFAULT_KEY, Edge.OUT_VERTEX_ID_PROPERTY_NAME, outVertexId, null, getTimestamp(), null, null, getFetchHints() ); } return outVertexIdProperty; }
protected Property getInVertexIdProperty() { if (inVertexIdProperty == null && this instanceof Edge) { String inVertexId = ((Edge) this).getVertexId(Direction.IN); inVertexIdProperty = new MutablePropertyImpl( ElementMutation.DEFAULT_KEY, Edge.IN_VERTEX_ID_PROPERTY_NAME, inVertexId, null, getTimestamp(), null, null, getFetchHints() ); } return inVertexIdProperty; }
protected Property getInOrOutVertexIdProperty() { if (inOrOutVertexIdProperty == null && this instanceof Edge) { String inVertexId = ((Edge) this).getVertexId(Direction.IN); String outVertexId = ((Edge) this).getVertexId(Direction.OUT); inOrOutVertexIdProperty = new MutablePropertyImpl( ElementMutation.DEFAULT_KEY, Edge.IN_OR_OUT_VERTEX_ID_PROPERTY_NAME, new EdgeVertexIds(outVertexId, inVertexId), null, getTimestamp(), null, null, getFetchHints() ); } return inOrOutVertexIdProperty; } }
protected Property getInOrOutVertexIdProperty() { if (inOrOutVertexIdProperty == null && this instanceof Edge) { String inVertexId = ((Edge) this).getVertexId(Direction.IN); String outVertexId = ((Edge) this).getVertexId(Direction.OUT); inOrOutVertexIdProperty = new MutablePropertyImpl( ElementMutation.DEFAULT_KEY, Edge.IN_OR_OUT_VERTEX_ID_PROPERTY_NAME, new EdgeVertexIds(outVertexId, inVertexId), null, getTimestamp(), null, null, getFetchHints() ); } return inOrOutVertexIdProperty; } }