/** * Filters vertices, edges and vertex properties based on their value. * * @param value the value of the {@link Element} * @param otherValues additional values of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> */ public default GraphTraversal<S, E> hasValue(final Object value, final Object... otherValues) { if (value instanceof P) return this.hasValue((P) value); else { final List<Object> values = new ArrayList<>(); if (value instanceof Object[]) { Collections.addAll(values, (Object[]) value); } else values.add(value); for (final Object v : otherValues) { if (v instanceof Object[]) { Collections.addAll(values, (Object[]) v); } else values.add(v); } this.asAdmin().getBytecode().addStep(Symbols.hasValue, values.toArray()); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.value.getAccessor(), values.size() == 1 ? P.eq(values.get(0)) : P.within(values))); } }
/** * Filters vertices, edges and vertex properties based on their properties. * * @param label the label of the {@link Element} * @param propertyKey the key of the property to filter on * @param predicate the filter to apply to the key's value * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.0.0-incubating */ public default GraphTraversal<S, E> has(final String label, final String propertyKey, final P<?> predicate) { this.asAdmin().getBytecode().addStep(Symbols.has, label, propertyKey, predicate); TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.label.getAccessor(), P.eq(label))); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(propertyKey, predicate)); }
/** * Filters vertices, edges and vertex properties based on their properties. * * @param propertyKey the key of the property to filter on * @param predicate the filter to apply to the key's value * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.0.0-incubating */ public default GraphTraversal<S, E> has(final String propertyKey, final P<?> predicate) { this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(propertyKey, predicate)); }
/** * Filters vertices, edges and vertex properties based on their label. * * @param predicate the filter to apply to the label of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.2.4 */ public default GraphTraversal<S, E> hasLabel(final P<String> predicate) { this.asAdmin().getBytecode().addStep(Symbols.hasLabel, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.label.getAccessor(), predicate)); }
/** * Filters vertices, edges and vertex properties based on their value. * * @param predicate the filter to apply to the value of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.2.4 */ public default GraphTraversal<S, E> hasValue(final P<Object> predicate) { this.asAdmin().getBytecode().addStep(Symbols.hasValue, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.value.getAccessor(), predicate)); }
/** * Filters vertices, edges and vertex properties based on their properties. * * @param label the label of the {@link Element} * @param propertyKey the key of the property to filter on * @param value the value to compare the accessor value to for equality * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.0.0-incubating */ public default GraphTraversal<S, E> has(final String label, final String propertyKey, final Object value) { this.asAdmin().getBytecode().addStep(Symbols.has, label, propertyKey, value); TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.label.getAccessor(), P.eq(label))); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(propertyKey, value instanceof P ? (P) value : P.eq(value))); }
return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.id.getAccessor(), ids.length == 1 ? P.eq(ids[0]) : P.within(ids)));
/** * Filters vertices, edges and vertex properties based on their properties. * * @param accessor the {@link T} accessor of the property to filter on * @param predicate the filter to apply to the key's value * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.0.0-incubating */ public default GraphTraversal<S, E> has(final T accessor, final P<?> predicate) { this.asAdmin().getBytecode().addStep(Symbols.has, accessor, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(accessor.getAccessor(), predicate)); }
/** * Filters vertices, edges and vertex properties based on their identifier. * * @param predicate the filter to apply to the identifier of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.2.4 */ public default GraphTraversal<S, E> hasId(final P<Object> predicate) { this.asAdmin().getBytecode().addStep(Symbols.hasId, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.id.getAccessor(), predicate)); }
/** * Filters vertices, edges and vertex properties based on their label. * * @param label the label of the {@link Element} * @param otherLabels additional labels of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.2.2 */ public default GraphTraversal<S, E> hasLabel(final String label, final String... otherLabels) { final String[] labels = new String[otherLabels.length + 1]; labels[0] = label; System.arraycopy(otherLabels, 0, labels, 1, otherLabels.length); this.asAdmin().getBytecode().addStep(Symbols.hasLabel, labels); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.label.getAccessor(), labels.length == 1 ? P.eq(labels[0]) : P.within(labels))); }
/** * Filters vertices, edges and vertex properties based on their key. * * @param predicate the filter to apply to the key of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.2.4 */ public default GraphTraversal<S, E> hasKey(final P<String> predicate) { this.asAdmin().getBytecode().addStep(Symbols.hasKey, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.key.getAccessor(), predicate)); }
/** * Filters vertices, edges and vertex properties based on their key. * * @param label the key of the {@link Element} * @param otherLabels additional key of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.2.2 */ public default GraphTraversal<S, E> hasKey(final String label, final String... otherLabels) { final String[] labels = new String[otherLabels.length + 1]; labels[0] = label; System.arraycopy(otherLabels, 0, labels, 1, otherLabels.length); this.asAdmin().getBytecode().addStep(Symbols.hasKey, labels); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.key.getAccessor(), labels.length == 1 ? P.eq(labels[0]) : P.within(labels))); }
/** * Filters vertices, edges and vertex properties based on their properties. * * @param propertyKey the key of the property to filter on * @param value the value to compare the property value to for equality * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.0.0-incubating */ public default GraphTraversal<S, E> has(final String propertyKey, final Object value) { if (value instanceof P) return this.has(propertyKey, (P) value); else if (value instanceof Traversal) return this.has(propertyKey, (Traversal) value); else { this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, value); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(propertyKey, P.eq(value))); } }
/** * Filters vertices, edges and vertex properties based on their properties. * * @param accessor the {@link T} accessor of the property to filter on * @param value the value to compare the accessor value to for equality * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.0.0-incubating */ public default GraphTraversal<S, E> has(final T accessor, final Object value) { if (value instanceof P) return this.has(accessor, (P) value); else if (value instanceof Traversal) return this.has(accessor, (Traversal) value); else { this.asAdmin().getBytecode().addStep(Symbols.has, accessor, value); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(accessor.getAccessor(), P.eq(value))); } }
/** * Filters vertices, edges and vertex properties based on their properties. * * @param propertyKey the key of the property to filter on * @param predicate the filter to apply to the key's value * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.0.0-incubating */ public default GraphTraversal<S, E> has(final String propertyKey, final P<?> predicate) { this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(propertyKey, predicate)); }
/** * Filters vertices, edges and vertex properties based on their identifier. * * @param predicate the filter to apply to the identifier of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.2.4 */ public default GraphTraversal<S, E> hasId(final P<Object> predicate) { this.asAdmin().getBytecode().addStep(Symbols.hasId, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.id.getAccessor(), predicate)); }
/** * Filters vertices, edges and vertex properties based on their value. * * @param predicate the filter to apply to the value of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.2.4 */ public default GraphTraversal<S, E> hasValue(final P<Object> predicate) { this.asAdmin().getBytecode().addStep(Symbols.hasValue, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.value.getAccessor(), predicate)); }
/** * Filters vertices, edges and vertex properties based on their key. * * @param predicate the filter to apply to the key of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.2.4 */ public default GraphTraversal<S, E> hasKey(final P<String> predicate) { this.asAdmin().getBytecode().addStep(Symbols.hasKey, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.key.getAccessor(), predicate)); }
/** * Filters vertices, edges and vertex properties based on their label. * * @param predicate the filter to apply to the label of the {@link Element} * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.2.4 */ public default GraphTraversal<S, E> hasLabel(final P<String> predicate) { this.asAdmin().getBytecode().addStep(Symbols.hasLabel, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(T.label.getAccessor(), predicate)); }
/** * Filters vertices, edges and vertex properties based on their properties. * * @param accessor the {@link T} accessor of the property to filter on * @param predicate the filter to apply to the key's value * @return the traversal with an appended {@link HasStep} * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#has-step" target="_blank">Reference Documentation - Has Step</a> * @since 3.0.0-incubating */ public default GraphTraversal<S, E> has(final T accessor, final P<?> predicate) { this.asAdmin().getBytecode().addStep(Symbols.has, accessor, predicate); return TraversalHelper.addHasContainer(this.asAdmin(), new HasContainer(accessor.getAccessor(), predicate)); }