io.opencannabis.schema.content.GenericContent 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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: content/Content.proto
package io.opencannabis.schema.content;
public final class GenericContent {
private GenericContent() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
/**
*
* Enumerates supported encodings for content data.
*
*
* Protobuf enum {@code opencannabis.content.Encoding}
*/
public enum Encoding
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* UTF-8 standard encoding.
*
*
* UTF8 = 0;
*/
UTF8(0),
/**
*
* Base-64 encoded UTF-8.
*
*
* B64 = 1;
*/
B64(1),
/**
*
* Base-64 encoded ASCII.
*
*
* B64_ASCII = 2;
*/
B64_ASCII(2),
UNRECOGNIZED(-1),
;
/**
*
* UTF-8 standard encoding.
*
*
* UTF8 = 0;
*/
public static final int UTF8_VALUE = 0;
/**
*
* Base-64 encoded UTF-8.
*
*
* B64 = 1;
*/
public static final int B64_VALUE = 1;
/**
*
* Base-64 encoded ASCII.
*
*
* B64_ASCII = 2;
*/
public static final int B64_ASCII_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Encoding valueOf(int value) {
return forNumber(value);
}
public static Encoding forNumber(int value) {
switch (value) {
case 0: return UTF8;
case 1: return B64;
case 2: return B64_ASCII;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Encoding> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Encoding findValueByNumber(int number) {
return Encoding.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return io.opencannabis.schema.content.GenericContent.getDescriptor().getEnumTypes().get(0);
}
private static final Encoding[] VALUES = values();
public static Encoding valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Encoding(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:opencannabis.content.Encoding)
}
public interface ContentOrBuilder extends
// @@protoc_insertion_point(interface_extends:opencannabis.content.Content)
com.google.protobuf.MessageOrBuilder {
/**
*
* Format/underlying type of content data.
*
*
* .opencannabis.content.Content.Type type = 1;
*/
int getTypeValue();
/**
*
* Format/underlying type of content data.
*
*
* .opencannabis.content.Content.Type type = 1;
*/
io.opencannabis.schema.content.GenericContent.Content.Type getType();
/**
*
* Encoding of underlying content data.
*
*
* .opencannabis.content.Encoding encoding = 2;
*/
int getEncodingValue();
/**
*
* Encoding of underlying content data.
*
*
* .opencannabis.content.Encoding encoding = 2;
*/
io.opencannabis.schema.content.GenericContent.Encoding getEncoding();
/**
*
* Language information for underlying content.
*
*
* .opencannabis.base.Language language = 3;
*/
int getLanguageValue();
/**
*
* Language information for underlying content.
*
*
* .opencannabis.base.Language language = 3;
*/
io.opencannabis.schema.base.BaseLanguage.Language getLanguage();
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
boolean hasCompression();
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
io.opencannabis.schema.base.BaseCompression.Compression getCompression();
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
io.opencannabis.schema.base.BaseCompression.CompressionOrBuilder getCompressionOrBuilder();
/**
*
* Raw bytes of underlying content data.
*
*
* string content = 10;
*/
java.lang.String getContent();
/**
*
* Raw bytes of underlying content data.
*
*
* string content = 10;
*/
com.google.protobuf.ByteString
getContentBytes();
/**
*
* Raw data attached to this content blob.
*
*
* bytes raw = 20;
*/
com.google.protobuf.ByteString getRaw();
public io.opencannabis.schema.content.GenericContent.Content.PayloadCase getPayloadCase();
}
/**
*
* Specifies a freeform content payload of some kind.
*
*
* Protobuf type {@code opencannabis.content.Content}
*/
public static final class Content extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:opencannabis.content.Content)
ContentOrBuilder {
private static final long serialVersionUID = 0L;
// Use Content.newBuilder() to construct.
private Content(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Content() {
type_ = 0;
encoding_ = 0;
language_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Content(
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 8: {
int rawValue = input.readEnum();
type_ = rawValue;
break;
}
case 16: {
int rawValue = input.readEnum();
encoding_ = rawValue;
break;
}
case 24: {
int rawValue = input.readEnum();
language_ = rawValue;
break;
}
case 34: {
io.opencannabis.schema.base.BaseCompression.Compression.Builder subBuilder = null;
if (compression_ != null) {
subBuilder = compression_.toBuilder();
}
compression_ = input.readMessage(io.opencannabis.schema.base.BaseCompression.Compression.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(compression_);
compression_ = subBuilder.buildPartial();
}
break;
}
case 82: {
java.lang.String s = input.readStringRequireUtf8();
payloadCase_ = 10;
payload_ = s;
break;
}
case 162: {
payloadCase_ = 20;
payload_ = input.readBytes();
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.opencannabis.schema.content.GenericContent.internal_static_opencannabis_content_Content_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.content.GenericContent.internal_static_opencannabis_content_Content_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.content.GenericContent.Content.class, io.opencannabis.schema.content.GenericContent.Content.Builder.class);
}
/**
*
* Enumerates supported types/formats for content data.
*
*
* Protobuf enum {@code opencannabis.content.Content.Type}
*/
public enum Type
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Plaintext format.
*
*
* TEXT = 0;
*/
TEXT(0),
/**
*
* Markdown format.
*
*
* MARKDOWN = 1;
*/
MARKDOWN(1),
/**
*
* HTML format.
*
*
* HTML = 2;
*/
HTML(2),
/**
*
* Binary data of some kind (for instance, images).
*
*
* BINARY = 3;
*/
BINARY(3),
UNRECOGNIZED(-1),
;
/**
*
* Plaintext format.
*
*
* TEXT = 0;
*/
public static final int TEXT_VALUE = 0;
/**
*
* Markdown format.
*
*
* MARKDOWN = 1;
*/
public static final int MARKDOWN_VALUE = 1;
/**
*
* HTML format.
*
*
* HTML = 2;
*/
public static final int HTML_VALUE = 2;
/**
*
* Binary data of some kind (for instance, images).
*
*
* BINARY = 3;
*/
public static final int BINARY_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Type valueOf(int value) {
return forNumber(value);
}
public static Type forNumber(int value) {
switch (value) {
case 0: return TEXT;
case 1: return MARKDOWN;
case 2: return HTML;
case 3: return BINARY;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Type> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Type findValueByNumber(int number) {
return Type.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return io.opencannabis.schema.content.GenericContent.Content.getDescriptor().getEnumTypes().get(0);
}
private static final Type[] VALUES = values();
public static Type valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Type(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:opencannabis.content.Content.Type)
}
private int payloadCase_ = 0;
private java.lang.Object payload_;
public enum PayloadCase
implements com.google.protobuf.Internal.EnumLite {
CONTENT(10),
RAW(20),
PAYLOAD_NOT_SET(0);
private final int value;
private PayloadCase(int value) {
this.value = value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static PayloadCase valueOf(int value) {
return forNumber(value);
}
public static PayloadCase forNumber(int value) {
switch (value) {
case 10: return CONTENT;
case 20: return RAW;
case 0: return PAYLOAD_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public PayloadCase
getPayloadCase() {
return PayloadCase.forNumber(
payloadCase_);
}
public static final int TYPE_FIELD_NUMBER = 1;
private int type_;
/**
*
* Format/underlying type of content data.
*
*
* .opencannabis.content.Content.Type type = 1;
*/
public int getTypeValue() {
return type_;
}
/**
*
* Format/underlying type of content data.
*
*
* .opencannabis.content.Content.Type type = 1;
*/
public io.opencannabis.schema.content.GenericContent.Content.Type getType() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.content.GenericContent.Content.Type result = io.opencannabis.schema.content.GenericContent.Content.Type.valueOf(type_);
return result == null ? io.opencannabis.schema.content.GenericContent.Content.Type.UNRECOGNIZED : result;
}
public static final int ENCODING_FIELD_NUMBER = 2;
private int encoding_;
/**
*
* Encoding of underlying content data.
*
*
* .opencannabis.content.Encoding encoding = 2;
*/
public int getEncodingValue() {
return encoding_;
}
/**
*
* Encoding of underlying content data.
*
*
* .opencannabis.content.Encoding encoding = 2;
*/
public io.opencannabis.schema.content.GenericContent.Encoding getEncoding() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.content.GenericContent.Encoding result = io.opencannabis.schema.content.GenericContent.Encoding.valueOf(encoding_);
return result == null ? io.opencannabis.schema.content.GenericContent.Encoding.UNRECOGNIZED : result;
}
public static final int LANGUAGE_FIELD_NUMBER = 3;
private int language_;
/**
*
* Language information for underlying content.
*
*
* .opencannabis.base.Language language = 3;
*/
public int getLanguageValue() {
return language_;
}
/**
*
* Language information for underlying content.
*
*
* .opencannabis.base.Language language = 3;
*/
public io.opencannabis.schema.base.BaseLanguage.Language getLanguage() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.base.BaseLanguage.Language result = io.opencannabis.schema.base.BaseLanguage.Language.valueOf(language_);
return result == null ? io.opencannabis.schema.base.BaseLanguage.Language.UNRECOGNIZED : result;
}
public static final int COMPRESSION_FIELD_NUMBER = 4;
private io.opencannabis.schema.base.BaseCompression.Compression compression_;
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public boolean hasCompression() {
return compression_ != null;
}
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public io.opencannabis.schema.base.BaseCompression.Compression getCompression() {
return compression_ == null ? io.opencannabis.schema.base.BaseCompression.Compression.getDefaultInstance() : compression_;
}
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public io.opencannabis.schema.base.BaseCompression.CompressionOrBuilder getCompressionOrBuilder() {
return getCompression();
}
public static final int CONTENT_FIELD_NUMBER = 10;
/**
*
* Raw bytes of underlying content data.
*
*
* string content = 10;
*/
public java.lang.String getContent() {
java.lang.Object ref = "";
if (payloadCase_ == 10) {
ref = payload_;
}
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();
if (payloadCase_ == 10) {
payload_ = s;
}
return s;
}
}
/**
*
* Raw bytes of underlying content data.
*
*
* string content = 10;
*/
public com.google.protobuf.ByteString
getContentBytes() {
java.lang.Object ref = "";
if (payloadCase_ == 10) {
ref = payload_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (payloadCase_ == 10) {
payload_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int RAW_FIELD_NUMBER = 20;
/**
*
* Raw data attached to this content blob.
*
*
* bytes raw = 20;
*/
public com.google.protobuf.ByteString getRaw() {
if (payloadCase_ == 20) {
return (com.google.protobuf.ByteString) payload_;
}
return com.google.protobuf.ByteString.EMPTY;
}
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_ != io.opencannabis.schema.content.GenericContent.Content.Type.TEXT.getNumber()) {
output.writeEnum(1, type_);
}
if (encoding_ != io.opencannabis.schema.content.GenericContent.Encoding.UTF8.getNumber()) {
output.writeEnum(2, encoding_);
}
if (language_ != io.opencannabis.schema.base.BaseLanguage.Language.LANGUAGE_UNSPECIFIED.getNumber()) {
output.writeEnum(3, language_);
}
if (compression_ != null) {
output.writeMessage(4, getCompression());
}
if (payloadCase_ == 10) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 10, payload_);
}
if (payloadCase_ == 20) {
output.writeBytes(
20, (com.google.protobuf.ByteString) payload_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (type_ != io.opencannabis.schema.content.GenericContent.Content.Type.TEXT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, type_);
}
if (encoding_ != io.opencannabis.schema.content.GenericContent.Encoding.UTF8.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, encoding_);
}
if (language_ != io.opencannabis.schema.base.BaseLanguage.Language.LANGUAGE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, language_);
}
if (compression_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getCompression());
}
if (payloadCase_ == 10) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, payload_);
}
if (payloadCase_ == 20) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(
20, (com.google.protobuf.ByteString) payload_);
}
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.opencannabis.schema.content.GenericContent.Content)) {
return super.equals(obj);
}
io.opencannabis.schema.content.GenericContent.Content other = (io.opencannabis.schema.content.GenericContent.Content) obj;
if (type_ != other.type_) return false;
if (encoding_ != other.encoding_) return false;
if (language_ != other.language_) return false;
if (hasCompression() != other.hasCompression()) return false;
if (hasCompression()) {
if (!getCompression()
.equals(other.getCompression())) return false;
}
if (!getPayloadCase().equals(other.getPayloadCase())) return false;
switch (payloadCase_) {
case 10:
if (!getContent()
.equals(other.getContent())) return false;
break;
case 20:
if (!getRaw()
.equals(other.getRaw())) 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();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
hash = (37 * hash) + ENCODING_FIELD_NUMBER;
hash = (53 * hash) + encoding_;
hash = (37 * hash) + LANGUAGE_FIELD_NUMBER;
hash = (53 * hash) + language_;
if (hasCompression()) {
hash = (37 * hash) + COMPRESSION_FIELD_NUMBER;
hash = (53 * hash) + getCompression().hashCode();
}
switch (payloadCase_) {
case 10:
hash = (37 * hash) + CONTENT_FIELD_NUMBER;
hash = (53 * hash) + getContent().hashCode();
break;
case 20:
hash = (37 * hash) + RAW_FIELD_NUMBER;
hash = (53 * hash) + getRaw().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.opencannabis.schema.content.GenericContent.Content parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.content.GenericContent.Content parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencannabis.schema.content.GenericContent.Content parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.content.GenericContent.Content parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencannabis.schema.content.GenericContent.Content parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.content.GenericContent.Content parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencannabis.schema.content.GenericContent.Content parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.content.GenericContent.Content 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.opencannabis.schema.content.GenericContent.Content parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.opencannabis.schema.content.GenericContent.Content 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.opencannabis.schema.content.GenericContent.Content parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.content.GenericContent.Content 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.opencannabis.schema.content.GenericContent.Content 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 a freeform content payload of some kind.
*
*
* Protobuf type {@code opencannabis.content.Content}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:opencannabis.content.Content)
io.opencannabis.schema.content.GenericContent.ContentOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencannabis.schema.content.GenericContent.internal_static_opencannabis_content_Content_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.content.GenericContent.internal_static_opencannabis_content_Content_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.content.GenericContent.Content.class, io.opencannabis.schema.content.GenericContent.Content.Builder.class);
}
// Construct using io.opencannabis.schema.content.GenericContent.Content.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();
type_ = 0;
encoding_ = 0;
language_ = 0;
if (compressionBuilder_ == null) {
compression_ = null;
} else {
compression_ = null;
compressionBuilder_ = null;
}
payloadCase_ = 0;
payload_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.opencannabis.schema.content.GenericContent.internal_static_opencannabis_content_Content_descriptor;
}
@java.lang.Override
public io.opencannabis.schema.content.GenericContent.Content getDefaultInstanceForType() {
return io.opencannabis.schema.content.GenericContent.Content.getDefaultInstance();
}
@java.lang.Override
public io.opencannabis.schema.content.GenericContent.Content build() {
io.opencannabis.schema.content.GenericContent.Content result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.opencannabis.schema.content.GenericContent.Content buildPartial() {
io.opencannabis.schema.content.GenericContent.Content result = new io.opencannabis.schema.content.GenericContent.Content(this);
result.type_ = type_;
result.encoding_ = encoding_;
result.language_ = language_;
if (compressionBuilder_ == null) {
result.compression_ = compression_;
} else {
result.compression_ = compressionBuilder_.build();
}
if (payloadCase_ == 10) {
result.payload_ = payload_;
}
if (payloadCase_ == 20) {
result.payload_ = payload_;
}
result.payloadCase_ = payloadCase_;
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.opencannabis.schema.content.GenericContent.Content) {
return mergeFrom((io.opencannabis.schema.content.GenericContent.Content)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.opencannabis.schema.content.GenericContent.Content other) {
if (other == io.opencannabis.schema.content.GenericContent.Content.getDefaultInstance()) return this;
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
if (other.encoding_ != 0) {
setEncodingValue(other.getEncodingValue());
}
if (other.language_ != 0) {
setLanguageValue(other.getLanguageValue());
}
if (other.hasCompression()) {
mergeCompression(other.getCompression());
}
switch (other.getPayloadCase()) {
case CONTENT: {
payloadCase_ = 10;
payload_ = other.payload_;
onChanged();
break;
}
case RAW: {
setRaw(other.getRaw());
break;
}
case PAYLOAD_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.opencannabis.schema.content.GenericContent.Content parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.opencannabis.schema.content.GenericContent.Content) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int payloadCase_ = 0;
private java.lang.Object payload_;
public PayloadCase
getPayloadCase() {
return PayloadCase.forNumber(
payloadCase_);
}
public Builder clearPayload() {
payloadCase_ = 0;
payload_ = null;
onChanged();
return this;
}
private int type_ = 0;
/**
*
* Format/underlying type of content data.
*
*
* .opencannabis.content.Content.Type type = 1;
*/
public int getTypeValue() {
return type_;
}
/**
*
* Format/underlying type of content data.
*
*
* .opencannabis.content.Content.Type type = 1;
*/
public Builder setTypeValue(int value) {
type_ = value;
onChanged();
return this;
}
/**
*
* Format/underlying type of content data.
*
*
* .opencannabis.content.Content.Type type = 1;
*/
public io.opencannabis.schema.content.GenericContent.Content.Type getType() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.content.GenericContent.Content.Type result = io.opencannabis.schema.content.GenericContent.Content.Type.valueOf(type_);
return result == null ? io.opencannabis.schema.content.GenericContent.Content.Type.UNRECOGNIZED : result;
}
/**
*
* Format/underlying type of content data.
*
*
* .opencannabis.content.Content.Type type = 1;
*/
public Builder setType(io.opencannabis.schema.content.GenericContent.Content.Type value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Format/underlying type of content data.
*
*
* .opencannabis.content.Content.Type type = 1;
*/
public Builder clearType() {
type_ = 0;
onChanged();
return this;
}
private int encoding_ = 0;
/**
*
* Encoding of underlying content data.
*
*
* .opencannabis.content.Encoding encoding = 2;
*/
public int getEncodingValue() {
return encoding_;
}
/**
*
* Encoding of underlying content data.
*
*
* .opencannabis.content.Encoding encoding = 2;
*/
public Builder setEncodingValue(int value) {
encoding_ = value;
onChanged();
return this;
}
/**
*
* Encoding of underlying content data.
*
*
* .opencannabis.content.Encoding encoding = 2;
*/
public io.opencannabis.schema.content.GenericContent.Encoding getEncoding() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.content.GenericContent.Encoding result = io.opencannabis.schema.content.GenericContent.Encoding.valueOf(encoding_);
return result == null ? io.opencannabis.schema.content.GenericContent.Encoding.UNRECOGNIZED : result;
}
/**
*
* Encoding of underlying content data.
*
*
* .opencannabis.content.Encoding encoding = 2;
*/
public Builder setEncoding(io.opencannabis.schema.content.GenericContent.Encoding value) {
if (value == null) {
throw new NullPointerException();
}
encoding_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Encoding of underlying content data.
*
*
* .opencannabis.content.Encoding encoding = 2;
*/
public Builder clearEncoding() {
encoding_ = 0;
onChanged();
return this;
}
private int language_ = 0;
/**
*
* Language information for underlying content.
*
*
* .opencannabis.base.Language language = 3;
*/
public int getLanguageValue() {
return language_;
}
/**
*
* Language information for underlying content.
*
*
* .opencannabis.base.Language language = 3;
*/
public Builder setLanguageValue(int value) {
language_ = value;
onChanged();
return this;
}
/**
*
* Language information for underlying content.
*
*
* .opencannabis.base.Language language = 3;
*/
public io.opencannabis.schema.base.BaseLanguage.Language getLanguage() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.base.BaseLanguage.Language result = io.opencannabis.schema.base.BaseLanguage.Language.valueOf(language_);
return result == null ? io.opencannabis.schema.base.BaseLanguage.Language.UNRECOGNIZED : result;
}
/**
*
* Language information for underlying content.
*
*
* .opencannabis.base.Language language = 3;
*/
public Builder setLanguage(io.opencannabis.schema.base.BaseLanguage.Language value) {
if (value == null) {
throw new NullPointerException();
}
language_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Language information for underlying content.
*
*
* .opencannabis.base.Language language = 3;
*/
public Builder clearLanguage() {
language_ = 0;
onChanged();
return this;
}
private io.opencannabis.schema.base.BaseCompression.Compression compression_;
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.base.BaseCompression.Compression, io.opencannabis.schema.base.BaseCompression.Compression.Builder, io.opencannabis.schema.base.BaseCompression.CompressionOrBuilder> compressionBuilder_;
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public boolean hasCompression() {
return compressionBuilder_ != null || compression_ != null;
}
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public io.opencannabis.schema.base.BaseCompression.Compression getCompression() {
if (compressionBuilder_ == null) {
return compression_ == null ? io.opencannabis.schema.base.BaseCompression.Compression.getDefaultInstance() : compression_;
} else {
return compressionBuilder_.getMessage();
}
}
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public Builder setCompression(io.opencannabis.schema.base.BaseCompression.Compression value) {
if (compressionBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
compression_ = value;
onChanged();
} else {
compressionBuilder_.setMessage(value);
}
return this;
}
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public Builder setCompression(
io.opencannabis.schema.base.BaseCompression.Compression.Builder builderForValue) {
if (compressionBuilder_ == null) {
compression_ = builderForValue.build();
onChanged();
} else {
compressionBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public Builder mergeCompression(io.opencannabis.schema.base.BaseCompression.Compression value) {
if (compressionBuilder_ == null) {
if (compression_ != null) {
compression_ =
io.opencannabis.schema.base.BaseCompression.Compression.newBuilder(compression_).mergeFrom(value).buildPartial();
} else {
compression_ = value;
}
onChanged();
} else {
compressionBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public Builder clearCompression() {
if (compressionBuilder_ == null) {
compression_ = null;
onChanged();
} else {
compression_ = null;
compressionBuilder_ = null;
}
return this;
}
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public io.opencannabis.schema.base.BaseCompression.Compression.Builder getCompressionBuilder() {
onChanged();
return getCompressionFieldBuilder().getBuilder();
}
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
public io.opencannabis.schema.base.BaseCompression.CompressionOrBuilder getCompressionOrBuilder() {
if (compressionBuilder_ != null) {
return compressionBuilder_.getMessageOrBuilder();
} else {
return compression_ == null ?
io.opencannabis.schema.base.BaseCompression.Compression.getDefaultInstance() : compression_;
}
}
/**
*
* Compression settings for underlying content.
*
*
* .opencannabis.base.Compression compression = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.base.BaseCompression.Compression, io.opencannabis.schema.base.BaseCompression.Compression.Builder, io.opencannabis.schema.base.BaseCompression.CompressionOrBuilder>
getCompressionFieldBuilder() {
if (compressionBuilder_ == null) {
compressionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.base.BaseCompression.Compression, io.opencannabis.schema.base.BaseCompression.Compression.Builder, io.opencannabis.schema.base.BaseCompression.CompressionOrBuilder>(
getCompression(),
getParentForChildren(),
isClean());
compression_ = null;
}
return compressionBuilder_;
}
/**
*
* Raw bytes of underlying content data.
*
*
* string content = 10;
*/
public java.lang.String getContent() {
java.lang.Object ref = "";
if (payloadCase_ == 10) {
ref = payload_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (payloadCase_ == 10) {
payload_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Raw bytes of underlying content data.
*
*
* string content = 10;
*/
public com.google.protobuf.ByteString
getContentBytes() {
java.lang.Object ref = "";
if (payloadCase_ == 10) {
ref = payload_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (payloadCase_ == 10) {
payload_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Raw bytes of underlying content data.
*
*
* string content = 10;
*/
public Builder setContent(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
payloadCase_ = 10;
payload_ = value;
onChanged();
return this;
}
/**
*
* Raw bytes of underlying content data.
*
*
* string content = 10;
*/
public Builder clearContent() {
if (payloadCase_ == 10) {
payloadCase_ = 0;
payload_ = null;
onChanged();
}
return this;
}
/**
*
* Raw bytes of underlying content data.
*
*
* string content = 10;
*/
public Builder setContentBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
payloadCase_ = 10;
payload_ = value;
onChanged();
return this;
}
/**
*
* Raw data attached to this content blob.
*
*
* bytes raw = 20;
*/
public com.google.protobuf.ByteString getRaw() {
if (payloadCase_ == 20) {
return (com.google.protobuf.ByteString) payload_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
* Raw data attached to this content blob.
*
*
* bytes raw = 20;
*/
public Builder setRaw(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
payloadCase_ = 20;
payload_ = value;
onChanged();
return this;
}
/**
*
* Raw data attached to this content blob.
*
*
* bytes raw = 20;
*/
public Builder clearRaw() {
if (payloadCase_ == 20) {
payloadCase_ = 0;
payload_ = 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:opencannabis.content.Content)
}
// @@protoc_insertion_point(class_scope:opencannabis.content.Content)
private static final io.opencannabis.schema.content.GenericContent.Content DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.opencannabis.schema.content.GenericContent.Content();
}
public static io.opencannabis.schema.content.GenericContent.Content getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Content parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Content(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.opencannabis.schema.content.GenericContent.Content getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_opencannabis_content_Content_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_opencannabis_content_Content_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\025content/Content.proto\022\024opencannabis.co" +
"ntent\032\016bq_field.proto\032\023base/Language.pro" +
"to\032\026base/Compression.proto\"\264\002\n\007Content\0220" +
"\n\004type\030\001 \001(\0162\".opencannabis.content.Cont" +
"ent.Type\0220\n\010encoding\030\002 \001(\0162\036.opencannabi" +
"s.content.Encoding\022-\n\010language\030\003 \001(\0162\033.o" +
"pencannabis.base.Language\0223\n\013compression" +
"\030\004 \001(\0132\036.opencannabis.base.Compression\022\021" +
"\n\007content\030\n \001(\tH\000\022\r\n\003raw\030\024 \001(\014H\000\"4\n\004Type" +
"\022\010\n\004TEXT\020\000\022\014\n\010MARKDOWN\020\001\022\010\n\004HTML\020\002\022\n\n\006BI" +
"NARY\020\003B\t\n\007payload*,\n\010Encoding\022\010\n\004UTF8\020\000\022" +
"\007\n\003B64\020\001\022\r\n\tB64_ASCII\020\002B:\n\036io.opencannab" +
"is.schema.contentB\016GenericContentH\001P\000\242\002\003" +
"OCSb\006proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
gen_bq_schema.BqField.getDescriptor(),
io.opencannabis.schema.base.BaseLanguage.getDescriptor(),
io.opencannabis.schema.base.BaseCompression.getDescriptor(),
}, assigner);
internal_static_opencannabis_content_Content_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_opencannabis_content_Content_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_opencannabis_content_Content_descriptor,
new java.lang.String[] { "Type", "Encoding", "Language", "Compression", "Content", "Raw", "Payload", });
gen_bq_schema.BqField.getDescriptor();
io.opencannabis.schema.base.BaseLanguage.getDescriptor();
io.opencannabis.schema.base.BaseCompression.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy