io.bloombox.schema.services.media.v1beta1.MediaContent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client Show documentation
Show all versions of java-client Show documentation
Java RPCAPI client for the Bloombox Cloud.
The newest version!
/*
* Copyright 2019, Momentum Ideas, Co. All rights reserved.
*
* Source and object computer code contained herein is the private intellectual
* property of Momentum Ideas Co., a Delaware Corporation. Use of this
* code in source form requires permission in writing before use or the
* assembly, distribution, or publishing of derivative works, for commercial
* purposes or any other purpose, from a duly authorized officer of Momentum
* Ideas Co.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: media/v1beta1/MediaService_Beta1.proto
package io.bloombox.schema.services.media.v1beta1;
/**
*
* Specifies media content uploaded inline via the API, if applicable for a given media upload request.
*
*
* Protobuf type {@code bloombox.services.media.v1beta1.MediaContent}
*/
public final class MediaContent extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:bloombox.services.media.v1beta1.MediaContent)
MediaContentOrBuilder {
private static final long serialVersionUID = 0L;
// Use MediaContent.newBuilder() to construct.
private MediaContent(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private MediaContent() {
name_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private MediaContent(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
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: {
io.opencannabis.schema.media.MediaItemType.MediaType.Builder subBuilder = null;
if (type_ != null) {
subBuilder = type_.toBuilder();
}
type_ = input.readMessage(io.opencannabis.schema.media.MediaItemType.MediaType.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(type_);
type_ = subBuilder.buildPartial();
}
break;
}
case 18: {
io.bloombox.schema.services.media.v1beta1.MediaFile.Builder subBuilder = null;
if (specCase_ == 2) {
subBuilder = ((io.bloombox.schema.services.media.v1beta1.MediaFile) spec_).toBuilder();
}
spec_ =
input.readMessage(io.bloombox.schema.services.media.v1beta1.MediaFile.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((io.bloombox.schema.services.media.v1beta1.MediaFile) spec_);
spec_ = subBuilder.buildPartial();
}
specCase_ = 2;
break;
}
case 24: {
specCase_ = 3;
spec_ = input.readBool();
break;
}
case 34: {
io.opencannabis.schema.content.GenericContent.Content.Builder subBuilder = null;
if (content_ != null) {
subBuilder = content_.toBuilder();
}
content_ = input.readMessage(io.opencannabis.schema.content.GenericContent.Content.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(content_);
content_ = subBuilder.buildPartial();
}
break;
}
case 42: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.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 io.bloombox.schema.services.media.v1beta1.MediaServiceBeta1.internal_static_bloombox_services_media_v1beta1_MediaContent_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.bloombox.schema.services.media.v1beta1.MediaServiceBeta1.internal_static_bloombox_services_media_v1beta1_MediaContent_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.bloombox.schema.services.media.v1beta1.MediaContent.class, io.bloombox.schema.services.media.v1beta1.MediaContent.Builder.class);
}
private int specCase_ = 0;
private java.lang.Object spec_;
public enum SpecCase
implements com.google.protobuf.Internal.EnumLite {
FILE(2),
BLOB(3),
SPEC_NOT_SET(0);
private final int value;
private SpecCase(int value) {
this.value = value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static SpecCase valueOf(int value) {
return forNumber(value);
}
public static SpecCase forNumber(int value) {
switch (value) {
case 2: return FILE;
case 3: return BLOB;
case 0: return SPEC_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public SpecCase
getSpecCase() {
return SpecCase.forNumber(
specCase_);
}
public static final int TYPE_FIELD_NUMBER = 1;
private io.opencannabis.schema.media.MediaItemType.MediaType type_;
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public boolean hasType() {
return type_ != null;
}
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public io.opencannabis.schema.media.MediaItemType.MediaType getType() {
return type_ == null ? io.opencannabis.schema.media.MediaItemType.MediaType.getDefaultInstance() : type_;
}
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public io.opencannabis.schema.media.MediaItemType.MediaTypeOrBuilder getTypeOrBuilder() {
return getType();
}
public static final int FILE_FIELD_NUMBER = 2;
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public boolean hasFile() {
return specCase_ == 2;
}
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public io.bloombox.schema.services.media.v1beta1.MediaFile getFile() {
if (specCase_ == 2) {
return (io.bloombox.schema.services.media.v1beta1.MediaFile) spec_;
}
return io.bloombox.schema.services.media.v1beta1.MediaFile.getDefaultInstance();
}
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public io.bloombox.schema.services.media.v1beta1.MediaFileOrBuilder getFileOrBuilder() {
if (specCase_ == 2) {
return (io.bloombox.schema.services.media.v1beta1.MediaFile) spec_;
}
return io.bloombox.schema.services.media.v1beta1.MediaFile.getDefaultInstance();
}
public static final int BLOB_FIELD_NUMBER = 3;
/**
*
* Flag indicating the specified/attached content is a raw data blob.
*
*
* bool blob = 3;
*/
public boolean getBlob() {
if (specCase_ == 3) {
return (java.lang.Boolean) spec_;
}
return false;
}
public static final int CONTENT_FIELD_NUMBER = 4;
private io.opencannabis.schema.content.GenericContent.Content content_;
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public boolean hasContent() {
return content_ != null;
}
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public io.opencannabis.schema.content.GenericContent.Content getContent() {
return content_ == null ? io.opencannabis.schema.content.GenericContent.Content.getDefaultInstance() : content_;
}
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public io.opencannabis.schema.content.GenericContent.ContentOrBuilder getContentOrBuilder() {
return getContent();
}
public static final int NAME_FIELD_NUMBER = 5;
private volatile java.lang.Object name_;
/**
*
* Name to give the media. Optional, and should be a human-readable label. Not usually based on a filename.
*
*
* string name = 5;
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
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();
name_ = s;
return s;
}
}
/**
*
* Name to give the media. Optional, and should be a human-readable label. Not usually based on a filename.
*
*
* string name = 5;
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
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 (type_ != null) {
output.writeMessage(1, getType());
}
if (specCase_ == 2) {
output.writeMessage(2, (io.bloombox.schema.services.media.v1beta1.MediaFile) spec_);
}
if (specCase_ == 3) {
output.writeBool(
3, (boolean)((java.lang.Boolean) spec_));
}
if (content_ != null) {
output.writeMessage(4, getContent());
}
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, name_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (type_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getType());
}
if (specCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, (io.bloombox.schema.services.media.v1beta1.MediaFile) spec_);
}
if (specCase_ == 3) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
3, (boolean)((java.lang.Boolean) spec_));
}
if (content_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getContent());
}
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, name_);
}
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 io.bloombox.schema.services.media.v1beta1.MediaContent)) {
return super.equals(obj);
}
io.bloombox.schema.services.media.v1beta1.MediaContent other = (io.bloombox.schema.services.media.v1beta1.MediaContent) obj;
if (hasType() != other.hasType()) return false;
if (hasType()) {
if (!getType()
.equals(other.getType())) return false;
}
if (hasContent() != other.hasContent()) return false;
if (hasContent()) {
if (!getContent()
.equals(other.getContent())) return false;
}
if (!getName()
.equals(other.getName())) return false;
if (!getSpecCase().equals(other.getSpecCase())) return false;
switch (specCase_) {
case 2:
if (!getFile()
.equals(other.getFile())) return false;
break;
case 3:
if (getBlob()
!= other.getBlob()) 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 (hasType()) {
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + getType().hashCode();
}
if (hasContent()) {
hash = (37 * hash) + CONTENT_FIELD_NUMBER;
hash = (53 * hash) + getContent().hashCode();
}
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
switch (specCase_) {
case 2:
hash = (37 * hash) + FILE_FIELD_NUMBER;
hash = (53 * hash) + getFile().hashCode();
break;
case 3:
hash = (37 * hash) + BLOB_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getBlob());
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent 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 io.bloombox.schema.services.media.v1beta1.MediaContent parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent 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 io.bloombox.schema.services.media.v1beta1.MediaContent parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent 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(io.bloombox.schema.services.media.v1beta1.MediaContent 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;
}
/**
*
* Specifies media content uploaded inline via the API, if applicable for a given media upload request.
*
*
* Protobuf type {@code bloombox.services.media.v1beta1.MediaContent}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:bloombox.services.media.v1beta1.MediaContent)
io.bloombox.schema.services.media.v1beta1.MediaContentOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.bloombox.schema.services.media.v1beta1.MediaServiceBeta1.internal_static_bloombox_services_media_v1beta1_MediaContent_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.bloombox.schema.services.media.v1beta1.MediaServiceBeta1.internal_static_bloombox_services_media_v1beta1_MediaContent_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.bloombox.schema.services.media.v1beta1.MediaContent.class, io.bloombox.schema.services.media.v1beta1.MediaContent.Builder.class);
}
// Construct using io.bloombox.schema.services.media.v1beta1.MediaContent.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 (typeBuilder_ == null) {
type_ = null;
} else {
type_ = null;
typeBuilder_ = null;
}
if (contentBuilder_ == null) {
content_ = null;
} else {
content_ = null;
contentBuilder_ = null;
}
name_ = "";
specCase_ = 0;
spec_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.bloombox.schema.services.media.v1beta1.MediaServiceBeta1.internal_static_bloombox_services_media_v1beta1_MediaContent_descriptor;
}
@java.lang.Override
public io.bloombox.schema.services.media.v1beta1.MediaContent getDefaultInstanceForType() {
return io.bloombox.schema.services.media.v1beta1.MediaContent.getDefaultInstance();
}
@java.lang.Override
public io.bloombox.schema.services.media.v1beta1.MediaContent build() {
io.bloombox.schema.services.media.v1beta1.MediaContent result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.bloombox.schema.services.media.v1beta1.MediaContent buildPartial() {
io.bloombox.schema.services.media.v1beta1.MediaContent result = new io.bloombox.schema.services.media.v1beta1.MediaContent(this);
if (typeBuilder_ == null) {
result.type_ = type_;
} else {
result.type_ = typeBuilder_.build();
}
if (specCase_ == 2) {
if (fileBuilder_ == null) {
result.spec_ = spec_;
} else {
result.spec_ = fileBuilder_.build();
}
}
if (specCase_ == 3) {
result.spec_ = spec_;
}
if (contentBuilder_ == null) {
result.content_ = content_;
} else {
result.content_ = contentBuilder_.build();
}
result.name_ = name_;
result.specCase_ = specCase_;
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 io.bloombox.schema.services.media.v1beta1.MediaContent) {
return mergeFrom((io.bloombox.schema.services.media.v1beta1.MediaContent)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.bloombox.schema.services.media.v1beta1.MediaContent other) {
if (other == io.bloombox.schema.services.media.v1beta1.MediaContent.getDefaultInstance()) return this;
if (other.hasType()) {
mergeType(other.getType());
}
if (other.hasContent()) {
mergeContent(other.getContent());
}
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
switch (other.getSpecCase()) {
case FILE: {
mergeFile(other.getFile());
break;
}
case BLOB: {
setBlob(other.getBlob());
break;
}
case SPEC_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 {
io.bloombox.schema.services.media.v1beta1.MediaContent parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.bloombox.schema.services.media.v1beta1.MediaContent) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int specCase_ = 0;
private java.lang.Object spec_;
public SpecCase
getSpecCase() {
return SpecCase.forNumber(
specCase_);
}
public Builder clearSpec() {
specCase_ = 0;
spec_ = null;
onChanged();
return this;
}
private io.opencannabis.schema.media.MediaItemType.MediaType type_;
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.media.MediaItemType.MediaType, io.opencannabis.schema.media.MediaItemType.MediaType.Builder, io.opencannabis.schema.media.MediaItemType.MediaTypeOrBuilder> typeBuilder_;
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public boolean hasType() {
return typeBuilder_ != null || type_ != null;
}
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public io.opencannabis.schema.media.MediaItemType.MediaType getType() {
if (typeBuilder_ == null) {
return type_ == null ? io.opencannabis.schema.media.MediaItemType.MediaType.getDefaultInstance() : type_;
} else {
return typeBuilder_.getMessage();
}
}
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public Builder setType(io.opencannabis.schema.media.MediaItemType.MediaType value) {
if (typeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
type_ = value;
onChanged();
} else {
typeBuilder_.setMessage(value);
}
return this;
}
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public Builder setType(
io.opencannabis.schema.media.MediaItemType.MediaType.Builder builderForValue) {
if (typeBuilder_ == null) {
type_ = builderForValue.build();
onChanged();
} else {
typeBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public Builder mergeType(io.opencannabis.schema.media.MediaItemType.MediaType value) {
if (typeBuilder_ == null) {
if (type_ != null) {
type_ =
io.opencannabis.schema.media.MediaItemType.MediaType.newBuilder(type_).mergeFrom(value).buildPartial();
} else {
type_ = value;
}
onChanged();
} else {
typeBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public Builder clearType() {
if (typeBuilder_ == null) {
type_ = null;
onChanged();
} else {
type_ = null;
typeBuilder_ = null;
}
return this;
}
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public io.opencannabis.schema.media.MediaItemType.MediaType.Builder getTypeBuilder() {
onChanged();
return getTypeFieldBuilder().getBuilder();
}
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
public io.opencannabis.schema.media.MediaItemType.MediaTypeOrBuilder getTypeOrBuilder() {
if (typeBuilder_ != null) {
return typeBuilder_.getMessageOrBuilder();
} else {
return type_ == null ?
io.opencannabis.schema.media.MediaItemType.MediaType.getDefaultInstance() : type_;
}
}
/**
*
* Type specification for the media being uploaded.
*
*
* .opencannabis.media.MediaType type = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.media.MediaItemType.MediaType, io.opencannabis.schema.media.MediaItemType.MediaType.Builder, io.opencannabis.schema.media.MediaItemType.MediaTypeOrBuilder>
getTypeFieldBuilder() {
if (typeBuilder_ == null) {
typeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.media.MediaItemType.MediaType, io.opencannabis.schema.media.MediaItemType.MediaType.Builder, io.opencannabis.schema.media.MediaItemType.MediaTypeOrBuilder>(
getType(),
getParentForChildren(),
isClean());
type_ = null;
}
return typeBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
io.bloombox.schema.services.media.v1beta1.MediaFile, io.bloombox.schema.services.media.v1beta1.MediaFile.Builder, io.bloombox.schema.services.media.v1beta1.MediaFileOrBuilder> fileBuilder_;
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public boolean hasFile() {
return specCase_ == 2;
}
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public io.bloombox.schema.services.media.v1beta1.MediaFile getFile() {
if (fileBuilder_ == null) {
if (specCase_ == 2) {
return (io.bloombox.schema.services.media.v1beta1.MediaFile) spec_;
}
return io.bloombox.schema.services.media.v1beta1.MediaFile.getDefaultInstance();
} else {
if (specCase_ == 2) {
return fileBuilder_.getMessage();
}
return io.bloombox.schema.services.media.v1beta1.MediaFile.getDefaultInstance();
}
}
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public Builder setFile(io.bloombox.schema.services.media.v1beta1.MediaFile value) {
if (fileBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
spec_ = value;
onChanged();
} else {
fileBuilder_.setMessage(value);
}
specCase_ = 2;
return this;
}
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public Builder setFile(
io.bloombox.schema.services.media.v1beta1.MediaFile.Builder builderForValue) {
if (fileBuilder_ == null) {
spec_ = builderForValue.build();
onChanged();
} else {
fileBuilder_.setMessage(builderForValue.build());
}
specCase_ = 2;
return this;
}
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public Builder mergeFile(io.bloombox.schema.services.media.v1beta1.MediaFile value) {
if (fileBuilder_ == null) {
if (specCase_ == 2 &&
spec_ != io.bloombox.schema.services.media.v1beta1.MediaFile.getDefaultInstance()) {
spec_ = io.bloombox.schema.services.media.v1beta1.MediaFile.newBuilder((io.bloombox.schema.services.media.v1beta1.MediaFile) spec_)
.mergeFrom(value).buildPartial();
} else {
spec_ = value;
}
onChanged();
} else {
if (specCase_ == 2) {
fileBuilder_.mergeFrom(value);
}
fileBuilder_.setMessage(value);
}
specCase_ = 2;
return this;
}
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public Builder clearFile() {
if (fileBuilder_ == null) {
if (specCase_ == 2) {
specCase_ = 0;
spec_ = null;
onChanged();
}
} else {
if (specCase_ == 2) {
specCase_ = 0;
spec_ = null;
}
fileBuilder_.clear();
}
return this;
}
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public io.bloombox.schema.services.media.v1beta1.MediaFile.Builder getFileBuilder() {
return getFileFieldBuilder().getBuilder();
}
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
public io.bloombox.schema.services.media.v1beta1.MediaFileOrBuilder getFileOrBuilder() {
if ((specCase_ == 2) && (fileBuilder_ != null)) {
return fileBuilder_.getMessageOrBuilder();
} else {
if (specCase_ == 2) {
return (io.bloombox.schema.services.media.v1beta1.MediaFile) spec_;
}
return io.bloombox.schema.services.media.v1beta1.MediaFile.getDefaultInstance();
}
}
/**
*
* Information about the file being uploaded, including the filename and content mime type.
*
*
* .bloombox.services.media.v1beta1.MediaFile file = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.bloombox.schema.services.media.v1beta1.MediaFile, io.bloombox.schema.services.media.v1beta1.MediaFile.Builder, io.bloombox.schema.services.media.v1beta1.MediaFileOrBuilder>
getFileFieldBuilder() {
if (fileBuilder_ == null) {
if (!(specCase_ == 2)) {
spec_ = io.bloombox.schema.services.media.v1beta1.MediaFile.getDefaultInstance();
}
fileBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.bloombox.schema.services.media.v1beta1.MediaFile, io.bloombox.schema.services.media.v1beta1.MediaFile.Builder, io.bloombox.schema.services.media.v1beta1.MediaFileOrBuilder>(
(io.bloombox.schema.services.media.v1beta1.MediaFile) spec_,
getParentForChildren(),
isClean());
spec_ = null;
}
specCase_ = 2;
onChanged();;
return fileBuilder_;
}
/**
*
* Flag indicating the specified/attached content is a raw data blob.
*
*
* bool blob = 3;
*/
public boolean getBlob() {
if (specCase_ == 3) {
return (java.lang.Boolean) spec_;
}
return false;
}
/**
*
* Flag indicating the specified/attached content is a raw data blob.
*
*
* bool blob = 3;
*/
public Builder setBlob(boolean value) {
specCase_ = 3;
spec_ = value;
onChanged();
return this;
}
/**
*
* Flag indicating the specified/attached content is a raw data blob.
*
*
* bool blob = 3;
*/
public Builder clearBlob() {
if (specCase_ == 3) {
specCase_ = 0;
spec_ = null;
onChanged();
}
return this;
}
private io.opencannabis.schema.content.GenericContent.Content content_;
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.content.GenericContent.Content, io.opencannabis.schema.content.GenericContent.Content.Builder, io.opencannabis.schema.content.GenericContent.ContentOrBuilder> contentBuilder_;
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public boolean hasContent() {
return contentBuilder_ != null || content_ != null;
}
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public io.opencannabis.schema.content.GenericContent.Content getContent() {
if (contentBuilder_ == null) {
return content_ == null ? io.opencannabis.schema.content.GenericContent.Content.getDefaultInstance() : content_;
} else {
return contentBuilder_.getMessage();
}
}
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public Builder setContent(io.opencannabis.schema.content.GenericContent.Content value) {
if (contentBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
content_ = value;
onChanged();
} else {
contentBuilder_.setMessage(value);
}
return this;
}
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public Builder setContent(
io.opencannabis.schema.content.GenericContent.Content.Builder builderForValue) {
if (contentBuilder_ == null) {
content_ = builderForValue.build();
onChanged();
} else {
contentBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public Builder mergeContent(io.opencannabis.schema.content.GenericContent.Content value) {
if (contentBuilder_ == null) {
if (content_ != null) {
content_ =
io.opencannabis.schema.content.GenericContent.Content.newBuilder(content_).mergeFrom(value).buildPartial();
} else {
content_ = value;
}
onChanged();
} else {
contentBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public Builder clearContent() {
if (contentBuilder_ == null) {
content_ = null;
onChanged();
} else {
content_ = null;
contentBuilder_ = null;
}
return this;
}
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public io.opencannabis.schema.content.GenericContent.Content.Builder getContentBuilder() {
onChanged();
return getContentFieldBuilder().getBuilder();
}
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
public io.opencannabis.schema.content.GenericContent.ContentOrBuilder getContentOrBuilder() {
if (contentBuilder_ != null) {
return contentBuilder_.getMessageOrBuilder();
} else {
return content_ == null ?
io.opencannabis.schema.content.GenericContent.Content.getDefaultInstance() : content_;
}
}
/**
*
* Raw data for the media content being uploaded, if applicable.
*
*
* .opencannabis.content.Content content = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.content.GenericContent.Content, io.opencannabis.schema.content.GenericContent.Content.Builder, io.opencannabis.schema.content.GenericContent.ContentOrBuilder>
getContentFieldBuilder() {
if (contentBuilder_ == null) {
contentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.content.GenericContent.Content, io.opencannabis.schema.content.GenericContent.Content.Builder, io.opencannabis.schema.content.GenericContent.ContentOrBuilder>(
getContent(),
getParentForChildren(),
isClean());
content_ = null;
}
return contentBuilder_;
}
private java.lang.Object name_ = "";
/**
*
* Name to give the media. Optional, and should be a human-readable label. Not usually based on a filename.
*
*
* string name = 5;
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Name to give the media. Optional, and should be a human-readable label. Not usually based on a filename.
*
*
* string name = 5;
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Name to give the media. Optional, and should be a human-readable label. Not usually based on a filename.
*
*
* string name = 5;
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
* Name to give the media. Optional, and should be a human-readable label. Not usually based on a filename.
*
*
* string name = 5;
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
* Name to give the media. Optional, and should be a human-readable label. Not usually based on a filename.
*
*
* string name = 5;
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = 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:bloombox.services.media.v1beta1.MediaContent)
}
// @@protoc_insertion_point(class_scope:bloombox.services.media.v1beta1.MediaContent)
private static final io.bloombox.schema.services.media.v1beta1.MediaContent DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.bloombox.schema.services.media.v1beta1.MediaContent();
}
public static io.bloombox.schema.services.media.v1beta1.MediaContent getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public MediaContent parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MediaContent(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 io.bloombox.schema.services.media.v1beta1.MediaContent getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy