com.clarifai.grpc.api.ConceptRelation Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: proto/clarifai/api/resources.proto
package com.clarifai.grpc.api;
/**
*
* This represents a relation (i.e. edge) between the subject concept and the object concept
*
*
* Protobuf type {@code clarifai.api.ConceptRelation}
*/
public final class ConceptRelation extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:clarifai.api.ConceptRelation)
ConceptRelationOrBuilder {
private static final long serialVersionUID = 0L;
// Use ConceptRelation.newBuilder() to construct.
private ConceptRelation(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ConceptRelation() {
id_ = "";
predicate_ = "";
knowledgeGraphId_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new ConceptRelation();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ConceptRelation(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
id_ = s;
break;
}
case 18: {
com.clarifai.grpc.api.Concept.Builder subBuilder = null;
if (subjectConcept_ != null) {
subBuilder = subjectConcept_.toBuilder();
}
subjectConcept_ = input.readMessage(com.clarifai.grpc.api.Concept.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(subjectConcept_);
subjectConcept_ = subBuilder.buildPartial();
}
break;
}
case 26: {
com.clarifai.grpc.api.Concept.Builder subBuilder = null;
if (objectConcept_ != null) {
subBuilder = objectConcept_.toBuilder();
}
objectConcept_ = input.readMessage(com.clarifai.grpc.api.Concept.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(objectConcept_);
objectConcept_ = subBuilder.buildPartial();
}
break;
}
case 34: {
java.lang.String s = input.readStringRequireUtf8();
predicate_ = s;
break;
}
case 42: {
java.lang.String s = input.readStringRequireUtf8();
knowledgeGraphId_ = s;
break;
}
case 50: {
com.clarifai.grpc.api.Visibility.Builder subBuilder = null;
if (visibility_ != null) {
subBuilder = visibility_.toBuilder();
}
visibility_ = input.readMessage(com.clarifai.grpc.api.Visibility.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(visibility_);
visibility_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_ConceptRelation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_ConceptRelation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.ConceptRelation.class, com.clarifai.grpc.api.ConceptRelation.Builder.class);
}
public static final int ID_FIELD_NUMBER = 1;
private volatile java.lang.Object id_;
/**
*
* ID of the concept relation
*
*
* string id = 1;
* @return The id.
*/
@java.lang.Override
public java.lang.String getId() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
id_ = s;
return s;
}
}
/**
*
* ID of the concept relation
*
*
* string id = 1;
* @return The bytes for id.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SUBJECT_CONCEPT_FIELD_NUMBER = 2;
private com.clarifai.grpc.api.Concept subjectConcept_;
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
* @return Whether the subjectConcept field is set.
*/
@java.lang.Override
public boolean hasSubjectConcept() {
return subjectConcept_ != null;
}
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
* @return The subjectConcept.
*/
@java.lang.Override
public com.clarifai.grpc.api.Concept getSubjectConcept() {
return subjectConcept_ == null ? com.clarifai.grpc.api.Concept.getDefaultInstance() : subjectConcept_;
}
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
*/
@java.lang.Override
public com.clarifai.grpc.api.ConceptOrBuilder getSubjectConceptOrBuilder() {
return getSubjectConcept();
}
public static final int OBJECT_CONCEPT_FIELD_NUMBER = 3;
private com.clarifai.grpc.api.Concept objectConcept_;
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
* @return Whether the objectConcept field is set.
*/
@java.lang.Override
public boolean hasObjectConcept() {
return objectConcept_ != null;
}
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
* @return The objectConcept.
*/
@java.lang.Override
public com.clarifai.grpc.api.Concept getObjectConcept() {
return objectConcept_ == null ? com.clarifai.grpc.api.Concept.getDefaultInstance() : objectConcept_;
}
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
*/
@java.lang.Override
public com.clarifai.grpc.api.ConceptOrBuilder getObjectConceptOrBuilder() {
return getObjectConcept();
}
public static final int PREDICATE_FIELD_NUMBER = 4;
private volatile java.lang.Object predicate_;
/**
*
* The predicate (i.e. edge) linking the subject and the object
* Both subject_concept and object_concept are concepts.
* The predicate is the type of relationship.
* That predicate acts on the subject.
* There are three current types of predicates:
* 1) "hyponym"
* 2) "hypernym"
* 3) "synonym"
* 1) For example, 'hyponym' is a type of predicate which represents 'is_a_kind_of' relation so
* the following relationship:
* 'honey' (subject), 'hyponym' (predicate), 'food' (object)
* Can more easily be read as:
* 'honey' 'is a kind of' 'food'
* 2) The 'hypernym' relation is the opposite of 'hyponym' and when you add one of the
* relationships the opposite will automatically appear for you in queries.
* The 'hypernym' can be read as 'is a parent of' so:
* 'food' (subject), 'hypernym' (predicate), 'honey' (object)
* Can more easily be read as:
* 'food' is a parent of 'honey'
* 3) The 'synonym' relation defines two concepts that essential mean the same thing. This
* is more like a "is" relationship. So for example a 'synonym' relationship could be:
* "puppy" is "pup"
* The reverse is also true once the former is added so:
* "pup" is "puppy"
* will appear in queries as well.
*
*
* string predicate = 4;
* @return The predicate.
*/
@java.lang.Override
public java.lang.String getPredicate() {
java.lang.Object ref = predicate_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
predicate_ = s;
return s;
}
}
/**
*
* The predicate (i.e. edge) linking the subject and the object
* Both subject_concept and object_concept are concepts.
* The predicate is the type of relationship.
* That predicate acts on the subject.
* There are three current types of predicates:
* 1) "hyponym"
* 2) "hypernym"
* 3) "synonym"
* 1) For example, 'hyponym' is a type of predicate which represents 'is_a_kind_of' relation so
* the following relationship:
* 'honey' (subject), 'hyponym' (predicate), 'food' (object)
* Can more easily be read as:
* 'honey' 'is a kind of' 'food'
* 2) The 'hypernym' relation is the opposite of 'hyponym' and when you add one of the
* relationships the opposite will automatically appear for you in queries.
* The 'hypernym' can be read as 'is a parent of' so:
* 'food' (subject), 'hypernym' (predicate), 'honey' (object)
* Can more easily be read as:
* 'food' is a parent of 'honey'
* 3) The 'synonym' relation defines two concepts that essential mean the same thing. This
* is more like a "is" relationship. So for example a 'synonym' relationship could be:
* "puppy" is "pup"
* The reverse is also true once the former is added so:
* "pup" is "puppy"
* will appear in queries as well.
*
*
* string predicate = 4;
* @return The bytes for predicate.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getPredicateBytes() {
java.lang.Object ref = predicate_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
predicate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int KNOWLEDGE_GRAPH_ID_FIELD_NUMBER = 5;
private volatile java.lang.Object knowledgeGraphId_;
/**
*
* The knowledge graph id that this edge belongs to. If using the app's global knowledge graph
* and not a specific one then this should be the empty string "".
*
*
* string knowledge_graph_id = 5;
* @return The knowledgeGraphId.
*/
@java.lang.Override
public java.lang.String getKnowledgeGraphId() {
java.lang.Object ref = knowledgeGraphId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
knowledgeGraphId_ = s;
return s;
}
}
/**
*
* The knowledge graph id that this edge belongs to. If using the app's global knowledge graph
* and not a specific one then this should be the empty string "".
*
*
* string knowledge_graph_id = 5;
* @return The bytes for knowledgeGraphId.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getKnowledgeGraphIdBytes() {
java.lang.Object ref = knowledgeGraphId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
knowledgeGraphId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int VISIBILITY_FIELD_NUMBER = 6;
private com.clarifai.grpc.api.Visibility visibility_;
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
* @return Whether the visibility field is set.
*/
@java.lang.Override
public boolean hasVisibility() {
return visibility_ != null;
}
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
* @return The visibility.
*/
@java.lang.Override
public com.clarifai.grpc.api.Visibility getVisibility() {
return visibility_ == null ? com.clarifai.grpc.api.Visibility.getDefaultInstance() : visibility_;
}
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
*/
@java.lang.Override
public com.clarifai.grpc.api.VisibilityOrBuilder getVisibilityOrBuilder() {
return getVisibility();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
}
if (subjectConcept_ != null) {
output.writeMessage(2, getSubjectConcept());
}
if (objectConcept_ != null) {
output.writeMessage(3, getObjectConcept());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(predicate_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, predicate_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(knowledgeGraphId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, knowledgeGraphId_);
}
if (visibility_ != null) {
output.writeMessage(6, getVisibility());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
}
if (subjectConcept_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getSubjectConcept());
}
if (objectConcept_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, getObjectConcept());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(predicate_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, predicate_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(knowledgeGraphId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, knowledgeGraphId_);
}
if (visibility_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, getVisibility());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.clarifai.grpc.api.ConceptRelation)) {
return super.equals(obj);
}
com.clarifai.grpc.api.ConceptRelation other = (com.clarifai.grpc.api.ConceptRelation) obj;
if (!getId()
.equals(other.getId())) return false;
if (hasSubjectConcept() != other.hasSubjectConcept()) return false;
if (hasSubjectConcept()) {
if (!getSubjectConcept()
.equals(other.getSubjectConcept())) return false;
}
if (hasObjectConcept() != other.hasObjectConcept()) return false;
if (hasObjectConcept()) {
if (!getObjectConcept()
.equals(other.getObjectConcept())) return false;
}
if (!getPredicate()
.equals(other.getPredicate())) return false;
if (!getKnowledgeGraphId()
.equals(other.getKnowledgeGraphId())) return false;
if (hasVisibility() != other.hasVisibility()) return false;
if (hasVisibility()) {
if (!getVisibility()
.equals(other.getVisibility())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + ID_FIELD_NUMBER;
hash = (53 * hash) + getId().hashCode();
if (hasSubjectConcept()) {
hash = (37 * hash) + SUBJECT_CONCEPT_FIELD_NUMBER;
hash = (53 * hash) + getSubjectConcept().hashCode();
}
if (hasObjectConcept()) {
hash = (37 * hash) + OBJECT_CONCEPT_FIELD_NUMBER;
hash = (53 * hash) + getObjectConcept().hashCode();
}
hash = (37 * hash) + PREDICATE_FIELD_NUMBER;
hash = (53 * hash) + getPredicate().hashCode();
hash = (37 * hash) + KNOWLEDGE_GRAPH_ID_FIELD_NUMBER;
hash = (53 * hash) + getKnowledgeGraphId().hashCode();
if (hasVisibility()) {
hash = (37 * hash) + VISIBILITY_FIELD_NUMBER;
hash = (53 * hash) + getVisibility().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.clarifai.grpc.api.ConceptRelation parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.ConceptRelation parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.ConceptRelation parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.ConceptRelation parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.ConceptRelation parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.ConceptRelation parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.ConceptRelation parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.ConceptRelation parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.clarifai.grpc.api.ConceptRelation parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.ConceptRelation parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.clarifai.grpc.api.ConceptRelation parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.ConceptRelation parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.clarifai.grpc.api.ConceptRelation prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* This represents a relation (i.e. edge) between the subject concept and the object concept
*
*
* Protobuf type {@code clarifai.api.ConceptRelation}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:clarifai.api.ConceptRelation)
com.clarifai.grpc.api.ConceptRelationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_ConceptRelation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_ConceptRelation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.ConceptRelation.class, com.clarifai.grpc.api.ConceptRelation.Builder.class);
}
// Construct using com.clarifai.grpc.api.ConceptRelation.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
id_ = "";
if (subjectConceptBuilder_ == null) {
subjectConcept_ = null;
} else {
subjectConcept_ = null;
subjectConceptBuilder_ = null;
}
if (objectConceptBuilder_ == null) {
objectConcept_ = null;
} else {
objectConcept_ = null;
objectConceptBuilder_ = null;
}
predicate_ = "";
knowledgeGraphId_ = "";
if (visibilityBuilder_ == null) {
visibility_ = null;
} else {
visibility_ = null;
visibilityBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_ConceptRelation_descriptor;
}
@java.lang.Override
public com.clarifai.grpc.api.ConceptRelation getDefaultInstanceForType() {
return com.clarifai.grpc.api.ConceptRelation.getDefaultInstance();
}
@java.lang.Override
public com.clarifai.grpc.api.ConceptRelation build() {
com.clarifai.grpc.api.ConceptRelation result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.clarifai.grpc.api.ConceptRelation buildPartial() {
com.clarifai.grpc.api.ConceptRelation result = new com.clarifai.grpc.api.ConceptRelation(this);
result.id_ = id_;
if (subjectConceptBuilder_ == null) {
result.subjectConcept_ = subjectConcept_;
} else {
result.subjectConcept_ = subjectConceptBuilder_.build();
}
if (objectConceptBuilder_ == null) {
result.objectConcept_ = objectConcept_;
} else {
result.objectConcept_ = objectConceptBuilder_.build();
}
result.predicate_ = predicate_;
result.knowledgeGraphId_ = knowledgeGraphId_;
if (visibilityBuilder_ == null) {
result.visibility_ = visibility_;
} else {
result.visibility_ = visibilityBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.clarifai.grpc.api.ConceptRelation) {
return mergeFrom((com.clarifai.grpc.api.ConceptRelation)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.clarifai.grpc.api.ConceptRelation other) {
if (other == com.clarifai.grpc.api.ConceptRelation.getDefaultInstance()) return this;
if (!other.getId().isEmpty()) {
id_ = other.id_;
onChanged();
}
if (other.hasSubjectConcept()) {
mergeSubjectConcept(other.getSubjectConcept());
}
if (other.hasObjectConcept()) {
mergeObjectConcept(other.getObjectConcept());
}
if (!other.getPredicate().isEmpty()) {
predicate_ = other.predicate_;
onChanged();
}
if (!other.getKnowledgeGraphId().isEmpty()) {
knowledgeGraphId_ = other.knowledgeGraphId_;
onChanged();
}
if (other.hasVisibility()) {
mergeVisibility(other.getVisibility());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.clarifai.grpc.api.ConceptRelation parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.clarifai.grpc.api.ConceptRelation) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object id_ = "";
/**
*
* ID of the concept relation
*
*
* string id = 1;
* @return The id.
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
id_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* ID of the concept relation
*
*
* string id = 1;
* @return The bytes for id.
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* ID of the concept relation
*
*
* string id = 1;
* @param value The id to set.
* @return This builder for chaining.
*/
public Builder setId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
id_ = value;
onChanged();
return this;
}
/**
*
* ID of the concept relation
*
*
* string id = 1;
* @return This builder for chaining.
*/
public Builder clearId() {
id_ = getDefaultInstance().getId();
onChanged();
return this;
}
/**
*
* ID of the concept relation
*
*
* string id = 1;
* @param value The bytes for id to set.
* @return This builder for chaining.
*/
public Builder setIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
id_ = value;
onChanged();
return this;
}
private com.clarifai.grpc.api.Concept subjectConcept_;
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Concept, com.clarifai.grpc.api.Concept.Builder, com.clarifai.grpc.api.ConceptOrBuilder> subjectConceptBuilder_;
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
* @return Whether the subjectConcept field is set.
*/
public boolean hasSubjectConcept() {
return subjectConceptBuilder_ != null || subjectConcept_ != null;
}
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
* @return The subjectConcept.
*/
public com.clarifai.grpc.api.Concept getSubjectConcept() {
if (subjectConceptBuilder_ == null) {
return subjectConcept_ == null ? com.clarifai.grpc.api.Concept.getDefaultInstance() : subjectConcept_;
} else {
return subjectConceptBuilder_.getMessage();
}
}
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
*/
public Builder setSubjectConcept(com.clarifai.grpc.api.Concept value) {
if (subjectConceptBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
subjectConcept_ = value;
onChanged();
} else {
subjectConceptBuilder_.setMessage(value);
}
return this;
}
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
*/
public Builder setSubjectConcept(
com.clarifai.grpc.api.Concept.Builder builderForValue) {
if (subjectConceptBuilder_ == null) {
subjectConcept_ = builderForValue.build();
onChanged();
} else {
subjectConceptBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
*/
public Builder mergeSubjectConcept(com.clarifai.grpc.api.Concept value) {
if (subjectConceptBuilder_ == null) {
if (subjectConcept_ != null) {
subjectConcept_ =
com.clarifai.grpc.api.Concept.newBuilder(subjectConcept_).mergeFrom(value).buildPartial();
} else {
subjectConcept_ = value;
}
onChanged();
} else {
subjectConceptBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
*/
public Builder clearSubjectConcept() {
if (subjectConceptBuilder_ == null) {
subjectConcept_ = null;
onChanged();
} else {
subjectConcept_ = null;
subjectConceptBuilder_ = null;
}
return this;
}
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
*/
public com.clarifai.grpc.api.Concept.Builder getSubjectConceptBuilder() {
onChanged();
return getSubjectConceptFieldBuilder().getBuilder();
}
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
*/
public com.clarifai.grpc.api.ConceptOrBuilder getSubjectConceptOrBuilder() {
if (subjectConceptBuilder_ != null) {
return subjectConceptBuilder_.getMessageOrBuilder();
} else {
return subjectConcept_ == null ?
com.clarifai.grpc.api.Concept.getDefaultInstance() : subjectConcept_;
}
}
/**
*
* The subject concept (i.e. source) of the concept relation
*
*
* .clarifai.api.Concept subject_concept = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Concept, com.clarifai.grpc.api.Concept.Builder, com.clarifai.grpc.api.ConceptOrBuilder>
getSubjectConceptFieldBuilder() {
if (subjectConceptBuilder_ == null) {
subjectConceptBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Concept, com.clarifai.grpc.api.Concept.Builder, com.clarifai.grpc.api.ConceptOrBuilder>(
getSubjectConcept(),
getParentForChildren(),
isClean());
subjectConcept_ = null;
}
return subjectConceptBuilder_;
}
private com.clarifai.grpc.api.Concept objectConcept_;
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Concept, com.clarifai.grpc.api.Concept.Builder, com.clarifai.grpc.api.ConceptOrBuilder> objectConceptBuilder_;
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
* @return Whether the objectConcept field is set.
*/
public boolean hasObjectConcept() {
return objectConceptBuilder_ != null || objectConcept_ != null;
}
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
* @return The objectConcept.
*/
public com.clarifai.grpc.api.Concept getObjectConcept() {
if (objectConceptBuilder_ == null) {
return objectConcept_ == null ? com.clarifai.grpc.api.Concept.getDefaultInstance() : objectConcept_;
} else {
return objectConceptBuilder_.getMessage();
}
}
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
*/
public Builder setObjectConcept(com.clarifai.grpc.api.Concept value) {
if (objectConceptBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
objectConcept_ = value;
onChanged();
} else {
objectConceptBuilder_.setMessage(value);
}
return this;
}
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
*/
public Builder setObjectConcept(
com.clarifai.grpc.api.Concept.Builder builderForValue) {
if (objectConceptBuilder_ == null) {
objectConcept_ = builderForValue.build();
onChanged();
} else {
objectConceptBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
*/
public Builder mergeObjectConcept(com.clarifai.grpc.api.Concept value) {
if (objectConceptBuilder_ == null) {
if (objectConcept_ != null) {
objectConcept_ =
com.clarifai.grpc.api.Concept.newBuilder(objectConcept_).mergeFrom(value).buildPartial();
} else {
objectConcept_ = value;
}
onChanged();
} else {
objectConceptBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
*/
public Builder clearObjectConcept() {
if (objectConceptBuilder_ == null) {
objectConcept_ = null;
onChanged();
} else {
objectConcept_ = null;
objectConceptBuilder_ = null;
}
return this;
}
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
*/
public com.clarifai.grpc.api.Concept.Builder getObjectConceptBuilder() {
onChanged();
return getObjectConceptFieldBuilder().getBuilder();
}
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
*/
public com.clarifai.grpc.api.ConceptOrBuilder getObjectConceptOrBuilder() {
if (objectConceptBuilder_ != null) {
return objectConceptBuilder_.getMessageOrBuilder();
} else {
return objectConcept_ == null ?
com.clarifai.grpc.api.Concept.getDefaultInstance() : objectConcept_;
}
}
/**
*
* The subject concept (i.e. destination) of the concept relation
*
*
* .clarifai.api.Concept object_concept = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Concept, com.clarifai.grpc.api.Concept.Builder, com.clarifai.grpc.api.ConceptOrBuilder>
getObjectConceptFieldBuilder() {
if (objectConceptBuilder_ == null) {
objectConceptBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Concept, com.clarifai.grpc.api.Concept.Builder, com.clarifai.grpc.api.ConceptOrBuilder>(
getObjectConcept(),
getParentForChildren(),
isClean());
objectConcept_ = null;
}
return objectConceptBuilder_;
}
private java.lang.Object predicate_ = "";
/**
*
* The predicate (i.e. edge) linking the subject and the object
* Both subject_concept and object_concept are concepts.
* The predicate is the type of relationship.
* That predicate acts on the subject.
* There are three current types of predicates:
* 1) "hyponym"
* 2) "hypernym"
* 3) "synonym"
* 1) For example, 'hyponym' is a type of predicate which represents 'is_a_kind_of' relation so
* the following relationship:
* 'honey' (subject), 'hyponym' (predicate), 'food' (object)
* Can more easily be read as:
* 'honey' 'is a kind of' 'food'
* 2) The 'hypernym' relation is the opposite of 'hyponym' and when you add one of the
* relationships the opposite will automatically appear for you in queries.
* The 'hypernym' can be read as 'is a parent of' so:
* 'food' (subject), 'hypernym' (predicate), 'honey' (object)
* Can more easily be read as:
* 'food' is a parent of 'honey'
* 3) The 'synonym' relation defines two concepts that essential mean the same thing. This
* is more like a "is" relationship. So for example a 'synonym' relationship could be:
* "puppy" is "pup"
* The reverse is also true once the former is added so:
* "pup" is "puppy"
* will appear in queries as well.
*
*
* string predicate = 4;
* @return The predicate.
*/
public java.lang.String getPredicate() {
java.lang.Object ref = predicate_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
predicate_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The predicate (i.e. edge) linking the subject and the object
* Both subject_concept and object_concept are concepts.
* The predicate is the type of relationship.
* That predicate acts on the subject.
* There are three current types of predicates:
* 1) "hyponym"
* 2) "hypernym"
* 3) "synonym"
* 1) For example, 'hyponym' is a type of predicate which represents 'is_a_kind_of' relation so
* the following relationship:
* 'honey' (subject), 'hyponym' (predicate), 'food' (object)
* Can more easily be read as:
* 'honey' 'is a kind of' 'food'
* 2) The 'hypernym' relation is the opposite of 'hyponym' and when you add one of the
* relationships the opposite will automatically appear for you in queries.
* The 'hypernym' can be read as 'is a parent of' so:
* 'food' (subject), 'hypernym' (predicate), 'honey' (object)
* Can more easily be read as:
* 'food' is a parent of 'honey'
* 3) The 'synonym' relation defines two concepts that essential mean the same thing. This
* is more like a "is" relationship. So for example a 'synonym' relationship could be:
* "puppy" is "pup"
* The reverse is also true once the former is added so:
* "pup" is "puppy"
* will appear in queries as well.
*
*
* string predicate = 4;
* @return The bytes for predicate.
*/
public com.google.protobuf.ByteString
getPredicateBytes() {
java.lang.Object ref = predicate_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
predicate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The predicate (i.e. edge) linking the subject and the object
* Both subject_concept and object_concept are concepts.
* The predicate is the type of relationship.
* That predicate acts on the subject.
* There are three current types of predicates:
* 1) "hyponym"
* 2) "hypernym"
* 3) "synonym"
* 1) For example, 'hyponym' is a type of predicate which represents 'is_a_kind_of' relation so
* the following relationship:
* 'honey' (subject), 'hyponym' (predicate), 'food' (object)
* Can more easily be read as:
* 'honey' 'is a kind of' 'food'
* 2) The 'hypernym' relation is the opposite of 'hyponym' and when you add one of the
* relationships the opposite will automatically appear for you in queries.
* The 'hypernym' can be read as 'is a parent of' so:
* 'food' (subject), 'hypernym' (predicate), 'honey' (object)
* Can more easily be read as:
* 'food' is a parent of 'honey'
* 3) The 'synonym' relation defines two concepts that essential mean the same thing. This
* is more like a "is" relationship. So for example a 'synonym' relationship could be:
* "puppy" is "pup"
* The reverse is also true once the former is added so:
* "pup" is "puppy"
* will appear in queries as well.
*
*
* string predicate = 4;
* @param value The predicate to set.
* @return This builder for chaining.
*/
public Builder setPredicate(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
predicate_ = value;
onChanged();
return this;
}
/**
*
* The predicate (i.e. edge) linking the subject and the object
* Both subject_concept and object_concept are concepts.
* The predicate is the type of relationship.
* That predicate acts on the subject.
* There are three current types of predicates:
* 1) "hyponym"
* 2) "hypernym"
* 3) "synonym"
* 1) For example, 'hyponym' is a type of predicate which represents 'is_a_kind_of' relation so
* the following relationship:
* 'honey' (subject), 'hyponym' (predicate), 'food' (object)
* Can more easily be read as:
* 'honey' 'is a kind of' 'food'
* 2) The 'hypernym' relation is the opposite of 'hyponym' and when you add one of the
* relationships the opposite will automatically appear for you in queries.
* The 'hypernym' can be read as 'is a parent of' so:
* 'food' (subject), 'hypernym' (predicate), 'honey' (object)
* Can more easily be read as:
* 'food' is a parent of 'honey'
* 3) The 'synonym' relation defines two concepts that essential mean the same thing. This
* is more like a "is" relationship. So for example a 'synonym' relationship could be:
* "puppy" is "pup"
* The reverse is also true once the former is added so:
* "pup" is "puppy"
* will appear in queries as well.
*
*
* string predicate = 4;
* @return This builder for chaining.
*/
public Builder clearPredicate() {
predicate_ = getDefaultInstance().getPredicate();
onChanged();
return this;
}
/**
*
* The predicate (i.e. edge) linking the subject and the object
* Both subject_concept and object_concept are concepts.
* The predicate is the type of relationship.
* That predicate acts on the subject.
* There are three current types of predicates:
* 1) "hyponym"
* 2) "hypernym"
* 3) "synonym"
* 1) For example, 'hyponym' is a type of predicate which represents 'is_a_kind_of' relation so
* the following relationship:
* 'honey' (subject), 'hyponym' (predicate), 'food' (object)
* Can more easily be read as:
* 'honey' 'is a kind of' 'food'
* 2) The 'hypernym' relation is the opposite of 'hyponym' and when you add one of the
* relationships the opposite will automatically appear for you in queries.
* The 'hypernym' can be read as 'is a parent of' so:
* 'food' (subject), 'hypernym' (predicate), 'honey' (object)
* Can more easily be read as:
* 'food' is a parent of 'honey'
* 3) The 'synonym' relation defines two concepts that essential mean the same thing. This
* is more like a "is" relationship. So for example a 'synonym' relationship could be:
* "puppy" is "pup"
* The reverse is also true once the former is added so:
* "pup" is "puppy"
* will appear in queries as well.
*
*
* string predicate = 4;
* @param value The bytes for predicate to set.
* @return This builder for chaining.
*/
public Builder setPredicateBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
predicate_ = value;
onChanged();
return this;
}
private java.lang.Object knowledgeGraphId_ = "";
/**
*
* The knowledge graph id that this edge belongs to. If using the app's global knowledge graph
* and not a specific one then this should be the empty string "".
*
*
* string knowledge_graph_id = 5;
* @return The knowledgeGraphId.
*/
public java.lang.String getKnowledgeGraphId() {
java.lang.Object ref = knowledgeGraphId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
knowledgeGraphId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The knowledge graph id that this edge belongs to. If using the app's global knowledge graph
* and not a specific one then this should be the empty string "".
*
*
* string knowledge_graph_id = 5;
* @return The bytes for knowledgeGraphId.
*/
public com.google.protobuf.ByteString
getKnowledgeGraphIdBytes() {
java.lang.Object ref = knowledgeGraphId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
knowledgeGraphId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The knowledge graph id that this edge belongs to. If using the app's global knowledge graph
* and not a specific one then this should be the empty string "".
*
*
* string knowledge_graph_id = 5;
* @param value The knowledgeGraphId to set.
* @return This builder for chaining.
*/
public Builder setKnowledgeGraphId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
knowledgeGraphId_ = value;
onChanged();
return this;
}
/**
*
* The knowledge graph id that this edge belongs to. If using the app's global knowledge graph
* and not a specific one then this should be the empty string "".
*
*
* string knowledge_graph_id = 5;
* @return This builder for chaining.
*/
public Builder clearKnowledgeGraphId() {
knowledgeGraphId_ = getDefaultInstance().getKnowledgeGraphId();
onChanged();
return this;
}
/**
*
* The knowledge graph id that this edge belongs to. If using the app's global knowledge graph
* and not a specific one then this should be the empty string "".
*
*
* string knowledge_graph_id = 5;
* @param value The bytes for knowledgeGraphId to set.
* @return This builder for chaining.
*/
public Builder setKnowledgeGraphIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
knowledgeGraphId_ = value;
onChanged();
return this;
}
private com.clarifai.grpc.api.Visibility visibility_;
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Visibility, com.clarifai.grpc.api.Visibility.Builder, com.clarifai.grpc.api.VisibilityOrBuilder> visibilityBuilder_;
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
* @return Whether the visibility field is set.
*/
public boolean hasVisibility() {
return visibilityBuilder_ != null || visibility_ != null;
}
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
* @return The visibility.
*/
public com.clarifai.grpc.api.Visibility getVisibility() {
if (visibilityBuilder_ == null) {
return visibility_ == null ? com.clarifai.grpc.api.Visibility.getDefaultInstance() : visibility_;
} else {
return visibilityBuilder_.getMessage();
}
}
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
*/
public Builder setVisibility(com.clarifai.grpc.api.Visibility value) {
if (visibilityBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
visibility_ = value;
onChanged();
} else {
visibilityBuilder_.setMessage(value);
}
return this;
}
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
*/
public Builder setVisibility(
com.clarifai.grpc.api.Visibility.Builder builderForValue) {
if (visibilityBuilder_ == null) {
visibility_ = builderForValue.build();
onChanged();
} else {
visibilityBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
*/
public Builder mergeVisibility(com.clarifai.grpc.api.Visibility value) {
if (visibilityBuilder_ == null) {
if (visibility_ != null) {
visibility_ =
com.clarifai.grpc.api.Visibility.newBuilder(visibility_).mergeFrom(value).buildPartial();
} else {
visibility_ = value;
}
onChanged();
} else {
visibilityBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
*/
public Builder clearVisibility() {
if (visibilityBuilder_ == null) {
visibility_ = null;
onChanged();
} else {
visibility_ = null;
visibilityBuilder_ = null;
}
return this;
}
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
*/
public com.clarifai.grpc.api.Visibility.Builder getVisibilityBuilder() {
onChanged();
return getVisibilityFieldBuilder().getBuilder();
}
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
*/
public com.clarifai.grpc.api.VisibilityOrBuilder getVisibilityOrBuilder() {
if (visibilityBuilder_ != null) {
return visibilityBuilder_.getMessageOrBuilder();
} else {
return visibility_ == null ?
com.clarifai.grpc.api.Visibility.getDefaultInstance() : visibility_;
}
}
/**
*
* The visibility field represents whether this message is privately/publicly visible.
* To be visible to the public the App that contains it AND the User that contains the App must
* also be publicly visible.
*
*
* .clarifai.api.Visibility visibility = 6;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Visibility, com.clarifai.grpc.api.Visibility.Builder, com.clarifai.grpc.api.VisibilityOrBuilder>
getVisibilityFieldBuilder() {
if (visibilityBuilder_ == null) {
visibilityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Visibility, com.clarifai.grpc.api.Visibility.Builder, com.clarifai.grpc.api.VisibilityOrBuilder>(
getVisibility(),
getParentForChildren(),
isClean());
visibility_ = null;
}
return visibilityBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:clarifai.api.ConceptRelation)
}
// @@protoc_insertion_point(class_scope:clarifai.api.ConceptRelation)
private static final com.clarifai.grpc.api.ConceptRelation DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.clarifai.grpc.api.ConceptRelation();
}
public static com.clarifai.grpc.api.ConceptRelation getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ConceptRelation parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ConceptRelation(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.clarifai.grpc.api.ConceptRelation getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}