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

org.vertexium.cli.model.LazyVertexProperty Maven / Gradle / Ivy

There is a newer version: 4.10.0
Show newest version
package org.vertexium.cli.model;

import org.vertexium.FetchHints;
import org.vertexium.Property;
import org.vertexium.Vertex;
import org.vertexium.Visibility;

public class LazyVertexProperty extends LazyProperty {
    private final String vertexId;

    public LazyVertexProperty(String vertexId, String key, String name, Visibility visibility) {
        super(key, name, visibility);
        this.vertexId = vertexId;
    }

    @Override
    protected String getToStringHeaderLine() {
        return "vertex @|bold " + getVertexId() + "|@ property";
    }

    @Override
    protected Vertex getE() {
        return getGraph().getVertex(getVertexId(), FetchHints.ALL_INCLUDING_HIDDEN, getTime(), getAuthorizations());
    }

    @Override
    protected Property getP() {
        Vertex vertex = getE();
        if (vertex == null) {
            return null;
        }
        return vertex.getProperty(getKey(), getName(), getVisibility());
    }

    public String getVertexId() {
        return vertexId;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy