/** * * * <pre> * Categories identified in the input document. * </pre> * * <code>repeated .google.cloud.language.v1beta2.ClassificationCategory categories = 6;</code> */ public Builder setCategories( int index, com.google.cloud.language.v1beta2.ClassificationCategory.Builder builderForValue) { if (categoriesBuilder_ == null) { ensureCategoriesIsMutable(); categories_.set(index, builderForValue.build()); onChanged(); } else { categoriesBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.language.v1beta2.ClassificationCategory parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.language.v1beta2.ClassificationCategory) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * * * <pre> * The name of the category representing the document. * </pre> * * <code>string name = 1;</code> */ public Builder setNameBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; }
/** * * * <pre> * Categories representing the input document. * </pre> * * <code>repeated .google.cloud.language.v1beta2.ClassificationCategory categories = 1;</code> */ public Builder addCategories( com.google.cloud.language.v1beta2.ClassificationCategory.Builder builderForValue) { if (categoriesBuilder_ == null) { ensureCategoriesIsMutable(); categories_.add(builderForValue.build()); onChanged(); } else { categoriesBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * Categories identified in the input document. * </pre> * * <code>repeated .google.cloud.language.v1beta2.ClassificationCategory categories = 6;</code> */ public Builder addCategories( com.google.cloud.language.v1beta2.ClassificationCategory.Builder builderForValue) { if (categoriesBuilder_ == null) { ensureCategoriesIsMutable(); categories_.add(builderForValue.build()); onChanged(); } else { categoriesBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * Categories identified in the input document. * </pre> * * <code>repeated .google.cloud.language.v1beta2.ClassificationCategory categories = 6;</code> */ public Builder addCategories( int index, com.google.cloud.language.v1beta2.ClassificationCategory.Builder builderForValue) { if (categoriesBuilder_ == null) { ensureCategoriesIsMutable(); categories_.add(index, builderForValue.build()); onChanged(); } else { categoriesBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Categories representing the input document. * </pre> * * <code>repeated .google.cloud.language.v1beta2.ClassificationCategory categories = 1;</code> */ public Builder addCategories( int index, com.google.cloud.language.v1beta2.ClassificationCategory.Builder builderForValue) { if (categoriesBuilder_ == null) { ensureCategoriesIsMutable(); categories_.add(index, builderForValue.build()); onChanged(); } else { categoriesBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Categories representing the input document. * </pre> * * <code>repeated .google.cloud.language.v1beta2.ClassificationCategory categories = 1;</code> */ public Builder setCategories( int index, com.google.cloud.language.v1beta2.ClassificationCategory.Builder builderForValue) { if (categoriesBuilder_ == null) { ensureCategoriesIsMutable(); categories_.set(index, builderForValue.build()); onChanged(); } else { categoriesBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * The name of the category representing the document. * </pre> * * <code>string name = 1;</code> */ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /**
/** * * * <pre> * The classifier's confidence of the category. Number represents how certain * the classifier is that this category represents the given text. * </pre> * * <code>float confidence = 2;</code> */ public Builder setConfidence(float value) { confidence_ = value; onChanged(); return this; } /**
/** * * * <pre> * The classifier's confidence of the category. Number represents how certain * the classifier is that this category represents the given text. * </pre> * * <code>float confidence = 2;</code> */ public Builder clearConfidence() { confidence_ = 0F; onChanged(); return this; }
/** * * * <pre> * The name of the category representing the document. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
private Builder() { maybeForceBuilderInitialization(); }
public Builder mergeFrom(com.google.cloud.language.v1beta2.ClassificationCategory other) { if (other == com.google.cloud.language.v1beta2.ClassificationCategory.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getConfidence() != 0F) { setConfidence(other.getConfidence()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); }
@java.lang.Override public com.google.cloud.language.v1beta2.ClassificationCategory buildPartial() { com.google.cloud.language.v1beta2.ClassificationCategory result = new com.google.cloud.language.v1beta2.ClassificationCategory(this); result.name_ = name_; result.confidence_ = confidence_; onBuilt(); return result; }
@java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
@java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.language.v1beta2.ClassificationCategory) { return mergeFrom((com.google.cloud.language.v1beta2.ClassificationCategory) other); } else { super.mergeFrom(other); return this; } }
@java.lang.Override public com.google.cloud.language.v1beta2.ClassificationCategory build() { com.google.cloud.language.v1beta2.ClassificationCategory result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }