com.clarifai.grpc.api.Worker 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;
/**
*
* Worker is the author of an annotation.
*
*
* Protobuf type {@code clarifai.api.Worker}
*/
public final class Worker extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:clarifai.api.Worker)
WorkerOrBuilder {
private static final long serialVersionUID = 0L;
// Use Worker.newBuilder() to construct.
private Worker(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Worker() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Worker();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Worker(
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: {
com.clarifai.grpc.api.User.Builder subBuilder = null;
if (workerCase_ == 1) {
subBuilder = ((com.clarifai.grpc.api.User) worker_).toBuilder();
}
worker_ =
input.readMessage(com.clarifai.grpc.api.User.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.clarifai.grpc.api.User) worker_);
worker_ = subBuilder.buildPartial();
}
workerCase_ = 1;
break;
}
case 18: {
com.clarifai.grpc.api.Model.Builder subBuilder = null;
if (workerCase_ == 2) {
subBuilder = ((com.clarifai.grpc.api.Model) worker_).toBuilder();
}
worker_ =
input.readMessage(com.clarifai.grpc.api.Model.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.clarifai.grpc.api.Model) worker_);
worker_ = subBuilder.buildPartial();
}
workerCase_ = 2;
break;
}
case 26: {
com.clarifai.grpc.api.Workflow.Builder subBuilder = null;
if (workerCase_ == 3) {
subBuilder = ((com.clarifai.grpc.api.Workflow) worker_).toBuilder();
}
worker_ =
input.readMessage(com.clarifai.grpc.api.Workflow.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.clarifai.grpc.api.Workflow) worker_);
worker_ = subBuilder.buildPartial();
}
workerCase_ = 3;
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_Worker_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Worker_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.Worker.class, com.clarifai.grpc.api.Worker.Builder.class);
}
private int workerCase_ = 0;
private java.lang.Object worker_;
public enum WorkerCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
USER(1),
MODEL(2),
WORKFLOW(3),
WORKER_NOT_SET(0);
private final int value;
private WorkerCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static WorkerCase valueOf(int value) {
return forNumber(value);
}
public static WorkerCase forNumber(int value) {
switch (value) {
case 1: return USER;
case 2: return MODEL;
case 3: return WORKFLOW;
case 0: return WORKER_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public WorkerCase
getWorkerCase() {
return WorkerCase.forNumber(
workerCase_);
}
public static final int USER_FIELD_NUMBER = 1;
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
* @return Whether the user field is set.
*/
@java.lang.Override
public boolean hasUser() {
return workerCase_ == 1;
}
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
* @return The user.
*/
@java.lang.Override
public com.clarifai.grpc.api.User getUser() {
if (workerCase_ == 1) {
return (com.clarifai.grpc.api.User) worker_;
}
return com.clarifai.grpc.api.User.getDefaultInstance();
}
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
*/
@java.lang.Override
public com.clarifai.grpc.api.UserOrBuilder getUserOrBuilder() {
if (workerCase_ == 1) {
return (com.clarifai.grpc.api.User) worker_;
}
return com.clarifai.grpc.api.User.getDefaultInstance();
}
public static final int MODEL_FIELD_NUMBER = 2;
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
* @return Whether the model field is set.
*/
@java.lang.Override
public boolean hasModel() {
return workerCase_ == 2;
}
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
* @return The model.
*/
@java.lang.Override
public com.clarifai.grpc.api.Model getModel() {
if (workerCase_ == 2) {
return (com.clarifai.grpc.api.Model) worker_;
}
return com.clarifai.grpc.api.Model.getDefaultInstance();
}
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
*/
@java.lang.Override
public com.clarifai.grpc.api.ModelOrBuilder getModelOrBuilder() {
if (workerCase_ == 2) {
return (com.clarifai.grpc.api.Model) worker_;
}
return com.clarifai.grpc.api.Model.getDefaultInstance();
}
public static final int WORKFLOW_FIELD_NUMBER = 3;
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
* @return Whether the workflow field is set.
*/
@java.lang.Override
public boolean hasWorkflow() {
return workerCase_ == 3;
}
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
* @return The workflow.
*/
@java.lang.Override
public com.clarifai.grpc.api.Workflow getWorkflow() {
if (workerCase_ == 3) {
return (com.clarifai.grpc.api.Workflow) worker_;
}
return com.clarifai.grpc.api.Workflow.getDefaultInstance();
}
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
*/
@java.lang.Override
public com.clarifai.grpc.api.WorkflowOrBuilder getWorkflowOrBuilder() {
if (workerCase_ == 3) {
return (com.clarifai.grpc.api.Workflow) worker_;
}
return com.clarifai.grpc.api.Workflow.getDefaultInstance();
}
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 (workerCase_ == 1) {
output.writeMessage(1, (com.clarifai.grpc.api.User) worker_);
}
if (workerCase_ == 2) {
output.writeMessage(2, (com.clarifai.grpc.api.Model) worker_);
}
if (workerCase_ == 3) {
output.writeMessage(3, (com.clarifai.grpc.api.Workflow) worker_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (workerCase_ == 1) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, (com.clarifai.grpc.api.User) worker_);
}
if (workerCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, (com.clarifai.grpc.api.Model) worker_);
}
if (workerCase_ == 3) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, (com.clarifai.grpc.api.Workflow) worker_);
}
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.Worker)) {
return super.equals(obj);
}
com.clarifai.grpc.api.Worker other = (com.clarifai.grpc.api.Worker) obj;
if (!getWorkerCase().equals(other.getWorkerCase())) return false;
switch (workerCase_) {
case 1:
if (!getUser()
.equals(other.getUser())) return false;
break;
case 2:
if (!getModel()
.equals(other.getModel())) return false;
break;
case 3:
if (!getWorkflow()
.equals(other.getWorkflow())) return false;
break;
case 0:
default:
}
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();
switch (workerCase_) {
case 1:
hash = (37 * hash) + USER_FIELD_NUMBER;
hash = (53 * hash) + getUser().hashCode();
break;
case 2:
hash = (37 * hash) + MODEL_FIELD_NUMBER;
hash = (53 * hash) + getModel().hashCode();
break;
case 3:
hash = (37 * hash) + WORKFLOW_FIELD_NUMBER;
hash = (53 * hash) + getWorkflow().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.clarifai.grpc.api.Worker parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.Worker 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.Worker parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.Worker 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.Worker parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.Worker parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.Worker parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.Worker 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.Worker parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.Worker 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.Worker parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.Worker 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.Worker 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;
}
/**
*
* Worker is the author of an annotation.
*
*
* Protobuf type {@code clarifai.api.Worker}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:clarifai.api.Worker)
com.clarifai.grpc.api.WorkerOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Worker_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Worker_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.Worker.class, com.clarifai.grpc.api.Worker.Builder.class);
}
// Construct using com.clarifai.grpc.api.Worker.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();
workerCase_ = 0;
worker_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Worker_descriptor;
}
@java.lang.Override
public com.clarifai.grpc.api.Worker getDefaultInstanceForType() {
return com.clarifai.grpc.api.Worker.getDefaultInstance();
}
@java.lang.Override
public com.clarifai.grpc.api.Worker build() {
com.clarifai.grpc.api.Worker result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.clarifai.grpc.api.Worker buildPartial() {
com.clarifai.grpc.api.Worker result = new com.clarifai.grpc.api.Worker(this);
if (workerCase_ == 1) {
if (userBuilder_ == null) {
result.worker_ = worker_;
} else {
result.worker_ = userBuilder_.build();
}
}
if (workerCase_ == 2) {
if (modelBuilder_ == null) {
result.worker_ = worker_;
} else {
result.worker_ = modelBuilder_.build();
}
}
if (workerCase_ == 3) {
if (workflowBuilder_ == null) {
result.worker_ = worker_;
} else {
result.worker_ = workflowBuilder_.build();
}
}
result.workerCase_ = workerCase_;
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.Worker) {
return mergeFrom((com.clarifai.grpc.api.Worker)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.clarifai.grpc.api.Worker other) {
if (other == com.clarifai.grpc.api.Worker.getDefaultInstance()) return this;
switch (other.getWorkerCase()) {
case USER: {
mergeUser(other.getUser());
break;
}
case MODEL: {
mergeModel(other.getModel());
break;
}
case WORKFLOW: {
mergeWorkflow(other.getWorkflow());
break;
}
case WORKER_NOT_SET: {
break;
}
}
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.Worker parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.clarifai.grpc.api.Worker) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int workerCase_ = 0;
private java.lang.Object worker_;
public WorkerCase
getWorkerCase() {
return WorkerCase.forNumber(
workerCase_);
}
public Builder clearWorker() {
workerCase_ = 0;
worker_ = null;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.User, com.clarifai.grpc.api.User.Builder, com.clarifai.grpc.api.UserOrBuilder> userBuilder_;
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
* @return Whether the user field is set.
*/
@java.lang.Override
public boolean hasUser() {
return workerCase_ == 1;
}
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
* @return The user.
*/
@java.lang.Override
public com.clarifai.grpc.api.User getUser() {
if (userBuilder_ == null) {
if (workerCase_ == 1) {
return (com.clarifai.grpc.api.User) worker_;
}
return com.clarifai.grpc.api.User.getDefaultInstance();
} else {
if (workerCase_ == 1) {
return userBuilder_.getMessage();
}
return com.clarifai.grpc.api.User.getDefaultInstance();
}
}
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
*/
public Builder setUser(com.clarifai.grpc.api.User value) {
if (userBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
worker_ = value;
onChanged();
} else {
userBuilder_.setMessage(value);
}
workerCase_ = 1;
return this;
}
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
*/
public Builder setUser(
com.clarifai.grpc.api.User.Builder builderForValue) {
if (userBuilder_ == null) {
worker_ = builderForValue.build();
onChanged();
} else {
userBuilder_.setMessage(builderForValue.build());
}
workerCase_ = 1;
return this;
}
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
*/
public Builder mergeUser(com.clarifai.grpc.api.User value) {
if (userBuilder_ == null) {
if (workerCase_ == 1 &&
worker_ != com.clarifai.grpc.api.User.getDefaultInstance()) {
worker_ = com.clarifai.grpc.api.User.newBuilder((com.clarifai.grpc.api.User) worker_)
.mergeFrom(value).buildPartial();
} else {
worker_ = value;
}
onChanged();
} else {
if (workerCase_ == 1) {
userBuilder_.mergeFrom(value);
} else {
userBuilder_.setMessage(value);
}
}
workerCase_ = 1;
return this;
}
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
*/
public Builder clearUser() {
if (userBuilder_ == null) {
if (workerCase_ == 1) {
workerCase_ = 0;
worker_ = null;
onChanged();
}
} else {
if (workerCase_ == 1) {
workerCase_ = 0;
worker_ = null;
}
userBuilder_.clear();
}
return this;
}
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
*/
public com.clarifai.grpc.api.User.Builder getUserBuilder() {
return getUserFieldBuilder().getBuilder();
}
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
*/
@java.lang.Override
public com.clarifai.grpc.api.UserOrBuilder getUserOrBuilder() {
if ((workerCase_ == 1) && (userBuilder_ != null)) {
return userBuilder_.getMessageOrBuilder();
} else {
if (workerCase_ == 1) {
return (com.clarifai.grpc.api.User) worker_;
}
return com.clarifai.grpc.api.User.getDefaultInstance();
}
}
/**
*
* User is the human that created the annotation.
* By default no real names of users are returned in responses. These can
* be requested with the 'names' additional field.
*
*
* .clarifai.api.User user = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.User, com.clarifai.grpc.api.User.Builder, com.clarifai.grpc.api.UserOrBuilder>
getUserFieldBuilder() {
if (userBuilder_ == null) {
if (!(workerCase_ == 1)) {
worker_ = com.clarifai.grpc.api.User.getDefaultInstance();
}
userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.User, com.clarifai.grpc.api.User.Builder, com.clarifai.grpc.api.UserOrBuilder>(
(com.clarifai.grpc.api.User) worker_,
getParentForChildren(),
isClean());
worker_ = null;
}
workerCase_ = 1;
onChanged();;
return userBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Model, com.clarifai.grpc.api.Model.Builder, com.clarifai.grpc.api.ModelOrBuilder> modelBuilder_;
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
* @return Whether the model field is set.
*/
@java.lang.Override
public boolean hasModel() {
return workerCase_ == 2;
}
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
* @return The model.
*/
@java.lang.Override
public com.clarifai.grpc.api.Model getModel() {
if (modelBuilder_ == null) {
if (workerCase_ == 2) {
return (com.clarifai.grpc.api.Model) worker_;
}
return com.clarifai.grpc.api.Model.getDefaultInstance();
} else {
if (workerCase_ == 2) {
return modelBuilder_.getMessage();
}
return com.clarifai.grpc.api.Model.getDefaultInstance();
}
}
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
*/
public Builder setModel(com.clarifai.grpc.api.Model value) {
if (modelBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
worker_ = value;
onChanged();
} else {
modelBuilder_.setMessage(value);
}
workerCase_ = 2;
return this;
}
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
*/
public Builder setModel(
com.clarifai.grpc.api.Model.Builder builderForValue) {
if (modelBuilder_ == null) {
worker_ = builderForValue.build();
onChanged();
} else {
modelBuilder_.setMessage(builderForValue.build());
}
workerCase_ = 2;
return this;
}
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
*/
public Builder mergeModel(com.clarifai.grpc.api.Model value) {
if (modelBuilder_ == null) {
if (workerCase_ == 2 &&
worker_ != com.clarifai.grpc.api.Model.getDefaultInstance()) {
worker_ = com.clarifai.grpc.api.Model.newBuilder((com.clarifai.grpc.api.Model) worker_)
.mergeFrom(value).buildPartial();
} else {
worker_ = value;
}
onChanged();
} else {
if (workerCase_ == 2) {
modelBuilder_.mergeFrom(value);
} else {
modelBuilder_.setMessage(value);
}
}
workerCase_ = 2;
return this;
}
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
*/
public Builder clearModel() {
if (modelBuilder_ == null) {
if (workerCase_ == 2) {
workerCase_ = 0;
worker_ = null;
onChanged();
}
} else {
if (workerCase_ == 2) {
workerCase_ = 0;
worker_ = null;
}
modelBuilder_.clear();
}
return this;
}
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
*/
public com.clarifai.grpc.api.Model.Builder getModelBuilder() {
return getModelFieldBuilder().getBuilder();
}
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
*/
@java.lang.Override
public com.clarifai.grpc.api.ModelOrBuilder getModelOrBuilder() {
if ((workerCase_ == 2) && (modelBuilder_ != null)) {
return modelBuilder_.getMessageOrBuilder();
} else {
if (workerCase_ == 2) {
return (com.clarifai.grpc.api.Model) worker_;
}
return com.clarifai.grpc.api.Model.getDefaultInstance();
}
}
/**
*
* Model is the model that created the annotation.
*
*
* .clarifai.api.Model model = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Model, com.clarifai.grpc.api.Model.Builder, com.clarifai.grpc.api.ModelOrBuilder>
getModelFieldBuilder() {
if (modelBuilder_ == null) {
if (!(workerCase_ == 2)) {
worker_ = com.clarifai.grpc.api.Model.getDefaultInstance();
}
modelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Model, com.clarifai.grpc.api.Model.Builder, com.clarifai.grpc.api.ModelOrBuilder>(
(com.clarifai.grpc.api.Model) worker_,
getParentForChildren(),
isClean());
worker_ = null;
}
workerCase_ = 2;
onChanged();;
return modelBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Workflow, com.clarifai.grpc.api.Workflow.Builder, com.clarifai.grpc.api.WorkflowOrBuilder> workflowBuilder_;
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
* @return Whether the workflow field is set.
*/
@java.lang.Override
public boolean hasWorkflow() {
return workerCase_ == 3;
}
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
* @return The workflow.
*/
@java.lang.Override
public com.clarifai.grpc.api.Workflow getWorkflow() {
if (workflowBuilder_ == null) {
if (workerCase_ == 3) {
return (com.clarifai.grpc.api.Workflow) worker_;
}
return com.clarifai.grpc.api.Workflow.getDefaultInstance();
} else {
if (workerCase_ == 3) {
return workflowBuilder_.getMessage();
}
return com.clarifai.grpc.api.Workflow.getDefaultInstance();
}
}
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
*/
public Builder setWorkflow(com.clarifai.grpc.api.Workflow value) {
if (workflowBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
worker_ = value;
onChanged();
} else {
workflowBuilder_.setMessage(value);
}
workerCase_ = 3;
return this;
}
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
*/
public Builder setWorkflow(
com.clarifai.grpc.api.Workflow.Builder builderForValue) {
if (workflowBuilder_ == null) {
worker_ = builderForValue.build();
onChanged();
} else {
workflowBuilder_.setMessage(builderForValue.build());
}
workerCase_ = 3;
return this;
}
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
*/
public Builder mergeWorkflow(com.clarifai.grpc.api.Workflow value) {
if (workflowBuilder_ == null) {
if (workerCase_ == 3 &&
worker_ != com.clarifai.grpc.api.Workflow.getDefaultInstance()) {
worker_ = com.clarifai.grpc.api.Workflow.newBuilder((com.clarifai.grpc.api.Workflow) worker_)
.mergeFrom(value).buildPartial();
} else {
worker_ = value;
}
onChanged();
} else {
if (workerCase_ == 3) {
workflowBuilder_.mergeFrom(value);
} else {
workflowBuilder_.setMessage(value);
}
}
workerCase_ = 3;
return this;
}
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
*/
public Builder clearWorkflow() {
if (workflowBuilder_ == null) {
if (workerCase_ == 3) {
workerCase_ = 0;
worker_ = null;
onChanged();
}
} else {
if (workerCase_ == 3) {
workerCase_ = 0;
worker_ = null;
}
workflowBuilder_.clear();
}
return this;
}
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
*/
public com.clarifai.grpc.api.Workflow.Builder getWorkflowBuilder() {
return getWorkflowFieldBuilder().getBuilder();
}
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
*/
@java.lang.Override
public com.clarifai.grpc.api.WorkflowOrBuilder getWorkflowOrBuilder() {
if ((workerCase_ == 3) && (workflowBuilder_ != null)) {
return workflowBuilder_.getMessageOrBuilder();
} else {
if (workerCase_ == 3) {
return (com.clarifai.grpc.api.Workflow) worker_;
}
return com.clarifai.grpc.api.Workflow.getDefaultInstance();
}
}
/**
*
* Workflow is the workflow that created the annotation.
*
*
* .clarifai.api.Workflow workflow = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Workflow, com.clarifai.grpc.api.Workflow.Builder, com.clarifai.grpc.api.WorkflowOrBuilder>
getWorkflowFieldBuilder() {
if (workflowBuilder_ == null) {
if (!(workerCase_ == 3)) {
worker_ = com.clarifai.grpc.api.Workflow.getDefaultInstance();
}
workflowBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Workflow, com.clarifai.grpc.api.Workflow.Builder, com.clarifai.grpc.api.WorkflowOrBuilder>(
(com.clarifai.grpc.api.Workflow) worker_,
getParentForChildren(),
isClean());
worker_ = null;
}
workerCase_ = 3;
onChanged();;
return workflowBuilder_;
}
@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.Worker)
}
// @@protoc_insertion_point(class_scope:clarifai.api.Worker)
private static final com.clarifai.grpc.api.Worker DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.clarifai.grpc.api.Worker();
}
public static com.clarifai.grpc.api.Worker getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Worker parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Worker(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.Worker getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}