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

ai.grakn.engine.controller.response.Keyspace Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
/*
 * Grakn - A Distributed Semantic Database
 * Copyright (C) 2016-2018 Grakn Labs Limited
 *
 * Grakn is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Grakn is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Grakn. If not, see .
 */

package ai.grakn.engine.controller.response;

import ai.grakn.API;
import ai.grakn.engine.Jacksonisable;
import ai.grakn.util.REST;
import ai.grakn.util.REST.WebPath;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.auto.value.AutoValue;

import javax.annotation.CheckReturnValue;

/**
 * 

* Response object representing {@link ai.grakn.Keyspace} *

* * @author Filipe Peliz Pinto Teixeira */ @AutoValue public abstract class Keyspace implements Jacksonisable { @API @CheckReturnValue public abstract ai.grakn.Keyspace value(); @API @CheckReturnValue @JsonCreator public static Keyspace of(ai.grakn.Keyspace value){ return new AutoValue_Keyspace(value); } @API @CheckReturnValue @JsonProperty("@id") public String id(){ return REST.resolveTemplate(WebPath.KB_KEYSPACE, name()); } @API @CheckReturnValue @JsonProperty public String name(){ return value().getValue(); } @API @CheckReturnValue @JsonProperty public String types(){ return REST.resolveTemplate(WebPath.KEYSPACE_TYPE, name()); } @API @CheckReturnValue @JsonProperty public String roles(){ return REST.resolveTemplate(WebPath.KEYSPACE_ROLE, name()); } @API @CheckReturnValue @JsonProperty public String rules(){ return REST.resolveTemplate(WebPath.KEYSPACE_RULE, name()); } @API @CheckReturnValue @JsonProperty public String graql(){ return REST.resolveTemplate(WebPath.KEYSPACE_GRAQL, name()); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy