All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lambdazen.bitsy.BitsyVertexProperty Maven / Gradle / Ivy

Go to download

Bitsy v3 is a small, fast, embeddable, durable in-memory graph database that is compatible with Tinkerpop3

There is a newer version: 3.6.2
Show newest version
package com.lambdazen.bitsy;

import java.util.Collections;
import java.util.Iterator;
import java.util.Set;

import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;

public class BitsyVertexProperty extends BitsyProperty implements VertexProperty {
	public BitsyVertexProperty(final BitsyVertex vertex, final String key, final V value) {
    	super(vertex, key, value);
    }

    @Override
    public Set keys() {
        return Collections.emptySet();
    }

    @Override
    public  Property property(final String key) {
    	throw new BitsyException(BitsyErrorCodes.NO_META_PROPERTY_SUPPORT);
    }

    @Override
    public  Property property(final String key, final U value) {
    	throw new BitsyException(BitsyErrorCodes.NO_META_PROPERTY_SUPPORT);
    }

    @Override
    public Vertex element() {
        return (BitsyVertex)super.element();
    }

    @Override
    public  Iterator> properties(final String... propertyKeys) {
    	throw new BitsyException(BitsyErrorCodes.NO_META_PROPERTY_SUPPORT);
    }

	@Override
	public Object id() {
		return element().id().toString() + ":" + key();
	}

    public String toString() {
        return StringFactory.propertyString(this);
    }
}