@Override public Set<String> keys() { if(null == this.vertexPropertyNode) return Collections.emptySet(); final Set<String> keys = new HashSet<>(); for (final String key : this.vertexPropertyNode.getKeys()) { if (!Graph.Hidden.isHidden(key) && !key.equals(this.key)) keys.add(key); } return Collections.unmodifiableSet(keys); }
public static boolean keyExists(final String key, final String... providedKeys) { if (Graph.Hidden.isHidden(key)) return false; if (0 == providedKeys.length) return true; if (1 == providedKeys.length) return key.equals(providedKeys[0]); else { for (final String temp : providedKeys) { if (temp.equals(key)) return true; } return false; } }
public List<EdgeLabel> getEdgeLabels() { return this.transaction.getEdgeLabels().stream() .filter(el -> !Graph.Hidden.isHidden(el.name())) .collect(Collectors.toList()); }
results = new FilterIterator<>(results, edge -> { if (!query.showHidden() && Graph.Hidden.isHidden(edge.label())) { return false;
if (Graph.Hidden.isHidden(label)) step.removeLabel(label);
public Iterator<Vertex> queryVertices(Query query) { Iterator<HugeVertex> results = this.queryVerticesFromBackend(query); // Filter unused or incorrect records results = new FilterIterator<>(results, vertex -> { assert vertex.schemaLabel() != VertexLabel.NONE; // Filter hidden results if (!query.showHidden() && Graph.Hidden.isHidden(vertex.label())) { return false; } // Process results that query from left index or primary-key if (query.resultType().isVertex() && !filterResultFromIndexQuery(query, vertex)) { // Only index query will come here return false; } return true; }); @SuppressWarnings("unchecked") Iterator<Vertex> r = (Iterator<Vertex>) joinTxVertices(query, results); return r; }
public static boolean hasLabels(final Traversal.Admin<?, ?> traversal) { for (final Step<?, ?> step : traversal.getSteps()) { for (final String label : step.getLabels()) { if (!Graph.Hidden.isHidden(label)) return true; } if (step instanceof TraversalParent) { for (final Traversal.Admin<?, ?> local : ((TraversalParent) step).getLocalChildren()) { if (TraversalHelper.hasLabels(local)) return true; } for (final Traversal.Admin<?, ?> global : ((TraversalParent) step).getGlobalChildren()) { if (TraversalHelper.hasLabels(global)) return true; } } } return false; }
/** * Determines whether the property key/value for the specified thing can be legally set. This is typically used as * a pre-condition check prior to setting a property. * * @param key the key of the property * @param value the value of the property * @throws IllegalArgumentException whether the key/value pair is legal and if not, a clear reason exception * message is provided */ public static void validateProperty(final String key, final Object value) throws IllegalArgumentException { if (null == value) throw Property.Exceptions.propertyValueCanNotBeNull(); if (null == key) throw Property.Exceptions.propertyKeyCanNotBeNull(); if (key.isEmpty()) throw Property.Exceptions.propertyKeyCanNotBeEmpty(); if (Graph.Hidden.isHidden(key)) throw Property.Exceptions.propertyKeyCanNotBeAHiddenKey(key); }
public boolean hidden() { return Graph.Hidden.isHidden(this.name()); }
@Watched(prefix = "schema") public Id validOrGenerateId(HugeType type, Id id, String name) { boolean forSystem = Graph.Hidden.isHidden(name); if (id != null) { this.checkIdAndUpdateNextId(type, id, name, forSystem); } else { if (forSystem) { id = this.getNextSystemId(); } else { id = this.getNextId(type); } } return id; }
/** * Determine whether the {@link Element} label can be legally set. This is typically used as a pre-condition check. * * @param label the element label * @throws IllegalArgumentException whether the label is legal and if not, a clear reason exception is provided */ public static void validateLabel(final String label) throws IllegalArgumentException { if (null == label) throw Element.Exceptions.labelCanNotBeNull(); if (label.isEmpty()) throw Element.Exceptions.labelCanNotBeEmpty(); if (Graph.Hidden.isHidden(label)) throw Element.Exceptions.labelCanNotBeAHiddenKey(label); }
public List<PropertyKey> getPropertyKeys() { return this.transaction.getPropertyKeys().stream() .filter(pk -> !Graph.Hidden.isHidden(pk.name())) .collect(Collectors.toList()); }
public List<IndexLabel> getIndexLabels() { return this.transaction.getIndexLabels().stream() .filter(il -> !Graph.Hidden.isHidden(il.name())) .collect(Collectors.toList()); }
public List<VertexLabel> getVertexLabels() { return this.transaction.getVertexLabels().stream() .filter(vl -> !Graph.Hidden.isHidden(vl.name())) .collect(Collectors.toList()); }
/** * Turn the provided key into a hidden key. If the key is already a hidden key, return key. * * @param key The key to make a hidden key * @return The hidden key */ public static String hide(final String key) { return isHidden(key) ? key : HIDDEN_PREFIX.concat(key); }
@Override public Set<String> keys() { this.graph.tx().readWrite(); final Set<String> keys = new HashSet<>(); for (final String key : this.baseGraph.getKeys()) { if (!Graph.Hidden.isHidden(key)) keys.add(key); } return keys; }
@Override public Set<String> keys() { this.graph.tx().readWrite(); final Set<String> keys = new HashSet<>(); for (final String key : this.baseElement.getKeys()) { if (!Graph.Hidden.isHidden(key)) keys.add(key); } return Collections.unmodifiableSet(keys); }
/** * Turn the provided hidden key into an non-hidden key. If the key is not a hidden key, return key. * * @param key The hidden key * @return The non-hidden representation of the key */ public static String unHide(final String key) { return isHidden(key) ? key.substring(HIDDEN_PREFIX_LENGTH) : key; }
public static boolean isSystemName(String name) { return Graph.Hidden.isHidden(name); }
public static boolean isSystemName(String name) { return Graph.Hidden.isHidden(name); }