implements
// @@protoc_insertion_point(builder_implements:clarifai.api.Hit)
com.clarifai.grpc.api.HitOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Hit_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Hit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.Hit.class, com.clarifai.grpc.api.Hit.Builder.class);
}
// Construct using com.clarifai.grpc.api.Hit.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();
score_ = 0F;
if (inputBuilder_ == null) {
input_ = null;
} else {
input_ = null;
inputBuilder_ = null;
}
if (annotationBuilder_ == null) {
annotation_ = null;
} else {
annotation_ = null;
annotationBuilder_ = null;
}
userId_ = "";
appId_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_Hit_descriptor;
}
@java.lang.Override
public com.clarifai.grpc.api.Hit getDefaultInstanceForType() {
return com.clarifai.grpc.api.Hit.getDefaultInstance();
}
@java.lang.Override
public com.clarifai.grpc.api.Hit build() {
com.clarifai.grpc.api.Hit result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.clarifai.grpc.api.Hit buildPartial() {
com.clarifai.grpc.api.Hit result = new com.clarifai.grpc.api.Hit(this);
result.score_ = score_;
if (inputBuilder_ == null) {
result.input_ = input_;
} else {
result.input_ = inputBuilder_.build();
}
if (annotationBuilder_ == null) {
result.annotation_ = annotation_;
} else {
result.annotation_ = annotationBuilder_.build();
}
result.userId_ = userId_;
result.appId_ = appId_;
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.Hit) {
return mergeFrom((com.clarifai.grpc.api.Hit)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.clarifai.grpc.api.Hit other) {
if (other == com.clarifai.grpc.api.Hit.getDefaultInstance()) return this;
if (other.getScore() != 0F) {
setScore(other.getScore());
}
if (other.hasInput()) {
mergeInput(other.getInput());
}
if (other.hasAnnotation()) {
mergeAnnotation(other.getAnnotation());
}
if (!other.getUserId().isEmpty()) {
userId_ = other.userId_;
onChanged();
}
if (!other.getAppId().isEmpty()) {
appId_ = other.appId_;
onChanged();
}
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.Hit parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.clarifai.grpc.api.Hit) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private float score_ ;
/**
*
* This is the score for the ranked Hit results of the search query. This score is a number
* between 0.0 and 1.0 as it represents a confidence in the search Hit. For example, if you search
* for "car" and get a close matching Hit, the score should be close to 1.0. If you get a score
* of close to 0.0 that means it's very disimilar to your query, in this case NOT a "car". There
* is a special intermediate score of 0.5 that means that the Hit is not really correlated with
* your search query (ie. not similar or dissimlar to the query) which is a common occurrence
* when using negate queries.
* Note: some queries that are just filtering down your app of inputs may just return a score of
* 1.0 for all Hits.
*
*
* float score = 1 [(.clarifai.api.utils.cl_show_if_empty) = true];
* @return The score.
*/
@java.lang.Override
public float getScore() {
return score_;
}
/**
*
* This is the score for the ranked Hit results of the search query. This score is a number
* between 0.0 and 1.0 as it represents a confidence in the search Hit. For example, if you search
* for "car" and get a close matching Hit, the score should be close to 1.0. If you get a score
* of close to 0.0 that means it's very disimilar to your query, in this case NOT a "car". There
* is a special intermediate score of 0.5 that means that the Hit is not really correlated with
* your search query (ie. not similar or dissimlar to the query) which is a common occurrence
* when using negate queries.
* Note: some queries that are just filtering down your app of inputs may just return a score of
* 1.0 for all Hits.
*
*
* float score = 1 [(.clarifai.api.utils.cl_show_if_empty) = true];
* @param value The score to set.
* @return This builder for chaining.
*/
public Builder setScore(float value) {
score_ = value;
onChanged();
return this;
}
/**
*
* This is the score for the ranked Hit results of the search query. This score is a number
* between 0.0 and 1.0 as it represents a confidence in the search Hit. For example, if you search
* for "car" and get a close matching Hit, the score should be close to 1.0. If you get a score
* of close to 0.0 that means it's very disimilar to your query, in this case NOT a "car". There
* is a special intermediate score of 0.5 that means that the Hit is not really correlated with
* your search query (ie. not similar or dissimlar to the query) which is a common occurrence
* when using negate queries.
* Note: some queries that are just filtering down your app of inputs may just return a score of
* 1.0 for all Hits.
*
*
* float score = 1 [(.clarifai.api.utils.cl_show_if_empty) = true];
* @return This builder for chaining.
*/
public Builder clearScore() {
score_ = 0F;
onChanged();
return this;
}
private com.clarifai.grpc.api.Input input_;
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Input, com.clarifai.grpc.api.Input.Builder, com.clarifai.grpc.api.InputOrBuilder> inputBuilder_;
/**
*
* This is the matched input returned from the search query. This will contain information about
* the Input such as the url, created_at time and trusted annotation information (for backwards
* compatibility with apps that existed before Annotations were introduced.
*
*
* .clarifai.api.Input input = 2;
* @return Whether the input field is set.
*/
public boolean hasInput() {
return inputBuilder_ != null || input_ != null;
}
/**
*
* This is the matched input returned from the search query. This will contain information about
* the Input such as the url, created_at time and trusted annotation information (for backwards
* compatibility with apps that existed before Annotations were introduced.
*
*
* .clarifai.api.Input input = 2;
* @return The input.
*/
public com.clarifai.grpc.api.Input getInput() {
if (inputBuilder_ == null) {
return input_ == null ? com.clarifai.grpc.api.Input.getDefaultInstance() : input_;
} else {
return inputBuilder_.getMessage();
}
}
/**
*
* This is the matched input returned from the search query. This will contain information about
* the Input such as the url, created_at time and trusted annotation information (for backwards
* compatibility with apps that existed before Annotations were introduced.
*
*
* .clarifai.api.Input input = 2;
*/
public Builder setInput(com.clarifai.grpc.api.Input value) {
if (inputBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
input_ = value;
onChanged();
} else {
inputBuilder_.setMessage(value);
}
return this;
}
/**
*
* This is the matched input returned from the search query. This will contain information about
* the Input such as the url, created_at time and trusted annotation information (for backwards
* compatibility with apps that existed before Annotations were introduced.
*
*
* .clarifai.api.Input input = 2;
*/
public Builder setInput(
com.clarifai.grpc.api.Input.Builder builderForValue) {
if (inputBuilder_ == null) {
input_ = builderForValue.build();
onChanged();
} else {
inputBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* This is the matched input returned from the search query. This will contain information about
* the Input such as the url, created_at time and trusted annotation information (for backwards
* compatibility with apps that existed before Annotations were introduced.
*
*
* .clarifai.api.Input input = 2;
*/
public Builder mergeInput(com.clarifai.grpc.api.Input value) {
if (inputBuilder_ == null) {
if (input_ != null) {
input_ =
com.clarifai.grpc.api.Input.newBuilder(input_).mergeFrom(value).buildPartial();
} else {
input_ = value;
}
onChanged();
} else {
inputBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* This is the matched input returned from the search query. This will contain information about
* the Input such as the url, created_at time and trusted annotation information (for backwards
* compatibility with apps that existed before Annotations were introduced.
*
*
* .clarifai.api.Input input = 2;
*/
public Builder clearInput() {
if (inputBuilder_ == null) {
input_ = null;
onChanged();
} else {
input_ = null;
inputBuilder_ = null;
}
return this;
}
/**
*
* This is the matched input returned from the search query. This will contain information about
* the Input such as the url, created_at time and trusted annotation information (for backwards
* compatibility with apps that existed before Annotations were introduced.
*
*
* .clarifai.api.Input input = 2;
*/
public com.clarifai.grpc.api.Input.Builder getInputBuilder() {
onChanged();
return getInputFieldBuilder().getBuilder();
}
/**
*
* This is the matched input returned from the search query. This will contain information about
* the Input such as the url, created_at time and trusted annotation information (for backwards
* compatibility with apps that existed before Annotations were introduced.
*
*
* .clarifai.api.Input input = 2;
*/
public com.clarifai.grpc.api.InputOrBuilder getInputOrBuilder() {
if (inputBuilder_ != null) {
return inputBuilder_.getMessageOrBuilder();
} else {
return input_ == null ?
com.clarifai.grpc.api.Input.getDefaultInstance() : input_;
}
}
/**
*
* This is the matched input returned from the search query. This will contain information about
* the Input such as the url, created_at time and trusted annotation information (for backwards
* compatibility with apps that existed before Annotations were introduced.
*
*
* .clarifai.api.Input input = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Input, com.clarifai.grpc.api.Input.Builder, com.clarifai.grpc.api.InputOrBuilder>
getInputFieldBuilder() {
if (inputBuilder_ == null) {
inputBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Input, com.clarifai.grpc.api.Input.Builder, com.clarifai.grpc.api.InputOrBuilder>(
getInput(),
getParentForChildren(),
isClean());
input_ = null;
}
return inputBuilder_;
}
private com.clarifai.grpc.api.Annotation annotation_;
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Annotation, com.clarifai.grpc.api.Annotation.Builder, com.clarifai.grpc.api.AnnotationOrBuilder> annotationBuilder_;
/**
*
* We also provide back the specific matched annotation for the above input. We do this in order
* to support more complex Annotation queries in the And message below. For example if we match
* the search results to a region in your input, or a frame in a video input, this annotation
* field will be that matched annotation info and the input will be the image/video that the user
* originally added which contains those regions / frames.
*
*
* .clarifai.api.Annotation annotation = 3;
* @return Whether the annotation field is set.
*/
public boolean hasAnnotation() {
return annotationBuilder_ != null || annotation_ != null;
}
/**
*
* We also provide back the specific matched annotation for the above input. We do this in order
* to support more complex Annotation queries in the And message below. For example if we match
* the search results to a region in your input, or a frame in a video input, this annotation
* field will be that matched annotation info and the input will be the image/video that the user
* originally added which contains those regions / frames.
*
*
* .clarifai.api.Annotation annotation = 3;
* @return The annotation.
*/
public com.clarifai.grpc.api.Annotation getAnnotation() {
if (annotationBuilder_ == null) {
return annotation_ == null ? com.clarifai.grpc.api.Annotation.getDefaultInstance() : annotation_;
} else {
return annotationBuilder_.getMessage();
}
}
/**
*
* We also provide back the specific matched annotation for the above input. We do this in order
* to support more complex Annotation queries in the And message below. For example if we match
* the search results to a region in your input, or a frame in a video input, this annotation
* field will be that matched annotation info and the input will be the image/video that the user
* originally added which contains those regions / frames.
*
*
* .clarifai.api.Annotation annotation = 3;
*/
public Builder setAnnotation(com.clarifai.grpc.api.Annotation value) {
if (annotationBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
annotation_ = value;
onChanged();
} else {
annotationBuilder_.setMessage(value);
}
return this;
}
/**
*
* We also provide back the specific matched annotation for the above input. We do this in order
* to support more complex Annotation queries in the And message below. For example if we match
* the search results to a region in your input, or a frame in a video input, this annotation
* field will be that matched annotation info and the input will be the image/video that the user
* originally added which contains those regions / frames.
*
*
* .clarifai.api.Annotation annotation = 3;
*/
public Builder setAnnotation(
com.clarifai.grpc.api.Annotation.Builder builderForValue) {
if (annotationBuilder_ == null) {
annotation_ = builderForValue.build();
onChanged();
} else {
annotationBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* We also provide back the specific matched annotation for the above input. We do this in order
* to support more complex Annotation queries in the And message below. For example if we match
* the search results to a region in your input, or a frame in a video input, this annotation
* field will be that matched annotation info and the input will be the image/video that the user
* originally added which contains those regions / frames.
*
*
* .clarifai.api.Annotation annotation = 3;
*/
public Builder mergeAnnotation(com.clarifai.grpc.api.Annotation value) {
if (annotationBuilder_ == null) {
if (annotation_ != null) {
annotation_ =
com.clarifai.grpc.api.Annotation.newBuilder(annotation_).mergeFrom(value).buildPartial();
} else {
annotation_ = value;
}
onChanged();
} else {
annotationBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* We also provide back the specific matched annotation for the above input. We do this in order
* to support more complex Annotation queries in the And message below. For example if we match
* the search results to a region in your input, or a frame in a video input, this annotation
* field will be that matched annotation info and the input will be the image/video that the user
* originally added which contains those regions / frames.
*
*
* .clarifai.api.Annotation annotation = 3;
*/
public Builder clearAnnotation() {
if (annotationBuilder_ == null) {
annotation_ = null;
onChanged();
} else {
annotation_ = null;
annotationBuilder_ = null;
}
return this;
}
/**
*
* We also provide back the specific matched annotation for the above input. We do this in order
* to support more complex Annotation queries in the And message below. For example if we match
* the search results to a region in your input, or a frame in a video input, this annotation
* field will be that matched annotation info and the input will be the image/video that the user
* originally added which contains those regions / frames.
*
*
* .clarifai.api.Annotation annotation = 3;
*/
public com.clarifai.grpc.api.Annotation.Builder getAnnotationBuilder() {
onChanged();
return getAnnotationFieldBuilder().getBuilder();
}
/**
*
* We also provide back the specific matched annotation for the above input. We do this in order
* to support more complex Annotation queries in the And message below. For example if we match
* the search results to a region in your input, or a frame in a video input, this annotation
* field will be that matched annotation info and the input will be the image/video that the user
* originally added which contains those regions / frames.
*
*
* .clarifai.api.Annotation annotation = 3;
*/
public com.clarifai.grpc.api.AnnotationOrBuilder getAnnotationOrBuilder() {
if (annotationBuilder_ != null) {
return annotationBuilder_.getMessageOrBuilder();
} else {
return annotation_ == null ?
com.clarifai.grpc.api.Annotation.getDefaultInstance() : annotation_;
}
}
/**
*
* We also provide back the specific matched annotation for the above input. We do this in order
* to support more complex Annotation queries in the And message below. For example if we match
* the search results to a region in your input, or a frame in a video input, this annotation
* field will be that matched annotation info and the input will be the image/video that the user
* originally added which contains those regions / frames.
*
*
* .clarifai.api.Annotation annotation = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Annotation, com.clarifai.grpc.api.Annotation.Builder, com.clarifai.grpc.api.AnnotationOrBuilder>
getAnnotationFieldBuilder() {
if (annotationBuilder_ == null) {
annotationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.Annotation, com.clarifai.grpc.api.Annotation.Builder, com.clarifai.grpc.api.AnnotationOrBuilder>(
getAnnotation(),
getParentForChildren(),
isClean());
annotation_ = null;
}
return annotationBuilder_;
}
private java.lang.Object userId_ = "";
/**
*
* The customer-facing id of the user who owns the app the asset came from.
*
*
* string user_id = 4;
* @return The userId.
*/
public java.lang.String getUserId() {
java.lang.Object ref = userId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
userId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The customer-facing id of the user who owns the app the asset came from.
*
*
* string user_id = 4;
* @return The bytes for userId.
*/
public com.google.protobuf.ByteString
getUserIdBytes() {
java.lang.Object ref = userId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
userId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The customer-facing id of the user who owns the app the asset came from.
*
*
* string user_id = 4;
* @param value The userId to set.
* @return This builder for chaining.
*/
public Builder setUserId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
userId_ = value;
onChanged();
return this;
}
/**
*
* The customer-facing id of the user who owns the app the asset came from.
*
*
* string user_id = 4;
* @return This builder for chaining.
*/
public Builder clearUserId() {
userId_ = getDefaultInstance().getUserId();
onChanged();
return this;
}
/**
*
* The customer-facing id of the user who owns the app the asset came from.
*
*
* string user_id = 4;
* @param value The bytes for userId to set.
* @return This builder for chaining.
*/
public Builder setUserIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
userId_ = value;
onChanged();
return this;
}
private java.lang.Object appId_ = "";
/**
*
* The cfid of the app the asset came from.
*
*
* string app_id = 5;
* @return The appId.
*/
public java.lang.String getAppId() {
java.lang.Object ref = appId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
appId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The cfid of the app the asset came from.
*
*
* string app_id = 5;
* @return The bytes for appId.
*/
public com.google.protobuf.ByteString
getAppIdBytes() {
java.lang.Object ref = appId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
appId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The cfid of the app the asset came from.
*
*
* string app_id = 5;
* @param value The appId to set.
* @return This builder for chaining.
*/
public Builder setAppId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
appId_ = value;
onChanged();
return this;
}
/**
*
* The cfid of the app the asset came from.
*
*
* string app_id = 5;
* @return This builder for chaining.
*/
public Builder clearAppId() {
appId_ = getDefaultInstance().getAppId();
onChanged();
return this;
}
/**
*
* The cfid of the app the asset came from.
*
*
* string app_id = 5;
* @param value The bytes for appId to set.
* @return This builder for chaining.
*/
public Builder setAppIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
appId_ = value;
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.Hit)
}
// @@protoc_insertion_point(class_scope:clarifai.api.Hit)
private static final com.clarifai.grpc.api.Hit DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.clarifai.grpc.api.Hit();
}
public static com.clarifai.grpc.api.Hit getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Hit parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Hit(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.Hit getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}