
com.tinkerpop.gremlin.hadoop.structure.HadoopVertexProperty Maven / Gradle / Ivy
The newest version!
package com.tinkerpop.gremlin.hadoop.structure;
import com.tinkerpop.gremlin.structure.Element;
import com.tinkerpop.gremlin.structure.Property;
import com.tinkerpop.gremlin.structure.Vertex;
import com.tinkerpop.gremlin.structure.VertexProperty;
import com.tinkerpop.gremlin.structure.util.ElementHelper;
import com.tinkerpop.gremlin.structure.util.wrapped.WrappedVertexProperty;
import com.tinkerpop.gremlin.util.iterator.IteratorUtils;
import java.util.Iterator;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
public class HadoopVertexProperty implements VertexProperty, VertexProperty.Iterators, WrappedVertexProperty> {
private final VertexProperty baseVertexProperty;
private final HadoopVertex hadoopVertex;
public HadoopVertexProperty(final VertexProperty baseVertexProperty, final HadoopVertex hadoopVertex) {
this.baseVertexProperty = baseVertexProperty;
this.hadoopVertex = hadoopVertex;
}
@Override
public Object id() {
return this.baseVertexProperty.id();
}
@Override
public V value() {
return this.baseVertexProperty.value();
}
@Override
public String key() {
return this.baseVertexProperty.key();
}
@Override
public void remove() {
this.baseVertexProperty.remove();
}
@Override
public boolean isPresent() {
return this.baseVertexProperty.isPresent();
}
@Override
public Property property(final String key) {
return this.baseVertexProperty.property(key);
}
@Override
public Property property(final String key, final U value) {
throw Element.Exceptions.propertyAdditionNotSupported();
}
@Override
public boolean equals(final Object object) {
return ElementHelper.areEqual(this, object);
}
@Override
public int hashCode() {
return this.baseVertexProperty.hashCode();
}
@Override
public String toString() {
return this.baseVertexProperty.toString();
}
@Override
public Vertex element() {
return this.hadoopVertex;
}
@Override
public VertexProperty getBaseVertexProperty() {
return this.baseVertexProperty;
}
@Override
public VertexProperty.Iterators iterators() {
return this;
}
@Override
public Iterator> propertyIterator(final String... propertyKeys) {
return IteratorUtils., Property>map(this.getBaseVertexProperty().iterators().propertyIterator(propertyKeys), property -> new HadoopProperty<>(property, HadoopVertexProperty.this));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy