com.clarifai.grpc.api.DatasetSplit 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;
/**
* Protobuf type {@code clarifai.api.DatasetSplit}
*/
public final class DatasetSplit extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:clarifai.api.DatasetSplit)
DatasetSplitOrBuilder {
private static final long serialVersionUID = 0L;
// Use DatasetSplit.newBuilder() to construct.
private DatasetSplit(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private DatasetSplit() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DatasetSplit();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DatasetSplit(
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.Dataset.Builder subBuilder = null;
if (dataset_ != null) {
subBuilder = dataset_.toBuilder();
}
dataset_ = input.readMessage(com.clarifai.grpc.api.Dataset.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(dataset_);
dataset_ = subBuilder.buildPartial();
}
break;
}
case 16: {
methodInfo_ = input.readUInt32();
methodInfoCase_ = 2;
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_DatasetSplit_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_DatasetSplit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.DatasetSplit.class, com.clarifai.grpc.api.DatasetSplit.Builder.class);
}
private int methodInfoCase_ = 0;
private java.lang.Object methodInfo_;
public enum MethodInfoCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
PERCENTAGE(2),
METHODINFO_NOT_SET(0);
private final int value;
private MethodInfoCase(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 MethodInfoCase valueOf(int value) {
return forNumber(value);
}
public static MethodInfoCase forNumber(int value) {
switch (value) {
case 2: return PERCENTAGE;
case 0: return METHODINFO_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public MethodInfoCase
getMethodInfoCase() {
return MethodInfoCase.forNumber(
methodInfoCase_);
}
public static final int DATASET_FIELD_NUMBER = 1;
private com.clarifai.grpc.api.Dataset dataset_;
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
* @return Whether the dataset field is set.
*/
@java.lang.Override
public boolean hasDataset() {
return dataset_ != null;
}
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
* @return The dataset.
*/
@java.lang.Override
public com.clarifai.grpc.api.Dataset getDataset() {
return dataset_ == null ? com.clarifai.grpc.api.Dataset.getDefaultInstance() : dataset_;
}
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
*/
@java.lang.Override
public com.clarifai.grpc.api.DatasetOrBuilder getDatasetOrBuilder() {
return getDataset();
}
public static final int PERCENTAGE_FIELD_NUMBER = 2;
/**
*
* For RANDOM_PERCENTAGE_SPLIT.
* Values from (0,100]
*
*
* uint32 percentage = 2;
* @return Whether the percentage field is set.
*/
@java.lang.Override
public boolean hasPercentage() {
return methodInfoCase_ == 2;
}
/**
*
* For RANDOM_PERCENTAGE_SPLIT.
* Values from (0,100]
*
*
* uint32 percentage = 2;
* @return The percentage.
*/
@java.lang.Override
public int getPercentage() {
if (methodInfoCase_ == 2) {
return (java.lang.Integer) methodInfo_;
}
return 0;
}
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 (dataset_ != null) {
output.writeMessage(1, getDataset());
}
if (methodInfoCase_ == 2) {
output.writeUInt32(
2, (int)((java.lang.Integer) methodInfo_));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (dataset_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getDataset());
}
if (methodInfoCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(
2, (int)((java.lang.Integer) methodInfo_));
}
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.DatasetSplit)) {
return super.equals(obj);
}
com.clarifai.grpc.api.DatasetSplit other = (com.clarifai.grpc.api.DatasetSplit) obj;
if (hasDataset() != other.hasDataset()) return false;
if (hasDataset()) {
if (!getDataset()
.equals(other.getDataset())) return false;
}
if (!getMethodInfoCase().equals(other.getMethodInfoCase())) return false;
switch (methodInfoCase_) {
case 2:
if (getPercentage()
!= other.getPercentage()) 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();
if (hasDataset()) {
hash = (37 * hash) + DATASET_FIELD_NUMBER;
hash = (53 * hash) + getDataset().hashCode();
}
switch (methodInfoCase_) {
case 2:
hash = (37 * hash) + PERCENTAGE_FIELD_NUMBER;
hash = (53 * hash) + getPercentage();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.clarifai.grpc.api.DatasetSplit parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.DatasetSplit 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.DatasetSplit parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.DatasetSplit 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.DatasetSplit parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.DatasetSplit parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.DatasetSplit parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.DatasetSplit 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.DatasetSplit parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.DatasetSplit 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.DatasetSplit parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.DatasetSplit 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.DatasetSplit 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;
}
/**
* Protobuf type {@code clarifai.api.DatasetSplit}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:clarifai.api.DatasetSplit)
com.clarifai.grpc.api.DatasetSplitOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_DatasetSplit_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_DatasetSplit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.DatasetSplit.class, com.clarifai.grpc.api.DatasetSplit.Builder.class);
}
// Construct using com.clarifai.grpc.api.DatasetSplit.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();
if (datasetBuilder_ == null) {
dataset_ = null;
} else {
dataset_ = null;
datasetBuilder_ = null;
}
methodInfoCase_ = 0;
methodInfo_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_DatasetSplit_descriptor;
}
@java.lang.Override
public com.clarifai.grpc.api.DatasetSplit getDefaultInstanceForType() {
return com.clarifai.grpc.api.DatasetSplit.getDefaultInstance();
}
@java.lang.Override
public com.clarifai.grpc.api.DatasetSplit build() {
com.clarifai.grpc.api.DatasetSplit result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.clarifai.grpc.api.DatasetSplit buildPartial() {
com.clarifai.grpc.api.DatasetSplit result = new com.clarifai.grpc.api.DatasetSplit(this);
if (datasetBuilder_ == null) {
result.dataset_ = dataset_;
} else {
result.dataset_ = datasetBuilder_.build();
}
if (methodInfoCase_ == 2) {
result.methodInfo_ = methodInfo_;
}
result.methodInfoCase_ = methodInfoCase_;
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.DatasetSplit) {
return mergeFrom((com.clarifai.grpc.api.DatasetSplit)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.clarifai.grpc.api.DatasetSplit other) {
if (other == com.clarifai.grpc.api.DatasetSplit.getDefaultInstance()) return this;
if (other.hasDataset()) {
mergeDataset(other.getDataset());
}
switch (other.getMethodInfoCase()) {
case PERCENTAGE: {
setPercentage(other.getPercentage());
break;
}
case METHODINFO_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.DatasetSplit parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.clarifai.grpc.api.DatasetSplit) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int methodInfoCase_ = 0;
private java.lang.Object methodInfo_;
public MethodInfoCase
getMethodInfoCase() {
return MethodInfoCase.forNumber(
methodInfoCase_);
}
public Builder clearMethodInfo() {
methodInfoCase_ = 0;
methodInfo_ = null;
onChanged();
return this;
}
private com.clarifai.grpc.api.Dataset dataset_;
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Dataset, com.clarifai.grpc.api.Dataset.Builder, com.clarifai.grpc.api.DatasetOrBuilder> datasetBuilder_;
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
* @return Whether the dataset field is set.
*/
public boolean hasDataset() {
return datasetBuilder_ != null || dataset_ != null;
}
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
* @return The dataset.
*/
public com.clarifai.grpc.api.Dataset getDataset() {
if (datasetBuilder_ == null) {
return dataset_ == null ? com.clarifai.grpc.api.Dataset.getDefaultInstance() : dataset_;
} else {
return datasetBuilder_.getMessage();
}
}
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
*/
public Builder setDataset(com.clarifai.grpc.api.Dataset value) {
if (datasetBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
dataset_ = value;
onChanged();
} else {
datasetBuilder_.setMessage(value);
}
return this;
}
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
*/
public Builder setDataset(
com.clarifai.grpc.api.Dataset.Builder builderForValue) {
if (datasetBuilder_ == null) {
dataset_ = builderForValue.build();
onChanged();
} else {
datasetBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
*/
public Builder mergeDataset(com.clarifai.grpc.api.Dataset value) {
if (datasetBuilder_ == null) {
if (dataset_ != null) {
dataset_ =
com.clarifai.grpc.api.Dataset.newBuilder(dataset_).mergeFrom(value).buildPartial();
} else {
dataset_ = value;
}
onChanged();
} else {
datasetBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
*/
public Builder clearDataset() {
if (datasetBuilder_ == null) {
dataset_ = null;
onChanged();
} else {
dataset_ = null;
datasetBuilder_ = null;
}
return this;
}
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
*/
public com.clarifai.grpc.api.Dataset.Builder getDatasetBuilder() {
onChanged();
return getDatasetFieldBuilder().getBuilder();
}
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
*/
public com.clarifai.grpc.api.DatasetOrBuilder getDatasetOrBuilder() {
if (datasetBuilder_ != null) {
return datasetBuilder_.getMessageOrBuilder();
} else {
return dataset_ == null ?
com.clarifai.grpc.api.Dataset.getDefaultInstance() : dataset_;
}
}
/**
*
* Expected to have ID
*
*
* .clarifai.api.Dataset dataset = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Dataset, com.clarifai.grpc.api.Dataset.Builder, com.clarifai.grpc.api.DatasetOrBuilder>
getDatasetFieldBuilder() {
if (datasetBuilder_ == null) {
datasetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Dataset, com.clarifai.grpc.api.Dataset.Builder, com.clarifai.grpc.api.DatasetOrBuilder>(
getDataset(),
getParentForChildren(),
isClean());
dataset_ = null;
}
return datasetBuilder_;
}
/**
*
* For RANDOM_PERCENTAGE_SPLIT.
* Values from (0,100]
*
*
* uint32 percentage = 2;
* @return Whether the percentage field is set.
*/
public boolean hasPercentage() {
return methodInfoCase_ == 2;
}
/**
*
* For RANDOM_PERCENTAGE_SPLIT.
* Values from (0,100]
*
*
* uint32 percentage = 2;
* @return The percentage.
*/
public int getPercentage() {
if (methodInfoCase_ == 2) {
return (java.lang.Integer) methodInfo_;
}
return 0;
}
/**
*
* For RANDOM_PERCENTAGE_SPLIT.
* Values from (0,100]
*
*
* uint32 percentage = 2;
* @param value The percentage to set.
* @return This builder for chaining.
*/
public Builder setPercentage(int value) {
methodInfoCase_ = 2;
methodInfo_ = value;
onChanged();
return this;
}
/**
*
* For RANDOM_PERCENTAGE_SPLIT.
* Values from (0,100]
*
*
* uint32 percentage = 2;
* @return This builder for chaining.
*/
public Builder clearPercentage() {
if (methodInfoCase_ == 2) {
methodInfoCase_ = 0;
methodInfo_ = null;
onChanged();
}
return this;
}
@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.DatasetSplit)
}
// @@protoc_insertion_point(class_scope:clarifai.api.DatasetSplit)
private static final com.clarifai.grpc.api.DatasetSplit DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.clarifai.grpc.api.DatasetSplit();
}
public static com.clarifai.grpc.api.DatasetSplit getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public DatasetSplit parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DatasetSplit(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.DatasetSplit getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}