io.opencannabis.schema.content.MaterialsContent 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/MaterialsData.proto
package io.opencannabis.schema.content;
public final class MaterialsContent {
private MaterialsContent() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface MaterialsDataOrBuilder extends
// @@protoc_insertion_point(interface_extends:opencannabis.content.MaterialsData)
com.google.protobuf.MessageOrBuilder {
/**
*
* Species of an item, if known.
*
*
* .opencannabis.structs.Species species = 1;
*/
int getSpeciesValue();
/**
*
* Species of an item, if known.
*
*
* .opencannabis.structs.Species species = 1;
*/
io.opencannabis.schema.product.struct.Species getSpecies();
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
boolean hasGenetics();
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
io.opencannabis.schema.product.struct.Genetics getGenetics();
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
io.opencannabis.schema.product.struct.GeneticsOrBuilder getGeneticsOrBuilder();
/**
*
* Specifies how this item was grown.
*
*
* .opencannabis.structs.Grow grow = 3;
*/
int getGrowValue();
/**
*
* Specifies how this item was grown.
*
*
* .opencannabis.structs.Grow grow = 3;
*/
io.opencannabis.schema.product.struct.Grow getGrow();
/**
*
* Shelf status of this product.
*
*
* .opencannabis.structs.Shelf shelf = 4;
*/
int getShelfValue();
/**
*
* Shelf status of this product.
*
*
* .opencannabis.structs.Shelf shelf = 4;
*/
io.opencannabis.schema.product.struct.Shelf getShelf();
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
java.util.List
getChannelList();
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
io.opencannabis.schema.product.DistributionChannel.DistributionPolicy getChannel(int index);
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
int getChannelCount();
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
java.util.List extends io.opencannabis.schema.product.DistributionChannel.DistributionPolicyOrBuilder>
getChannelOrBuilderList();
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
io.opencannabis.schema.product.DistributionChannel.DistributionPolicyOrBuilder getChannelOrBuilder(
int index);
}
/**
*
* Specifies materials-related data about a product that contains cannabis.
*
*
* Protobuf type {@code opencannabis.content.MaterialsData}
*/
public static final class MaterialsData extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:opencannabis.content.MaterialsData)
MaterialsDataOrBuilder {
private static final long serialVersionUID = 0L;
// Use MaterialsData.newBuilder() to construct.
private MaterialsData(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private MaterialsData() {
species_ = 0;
grow_ = 0;
shelf_ = 0;
channel_ = java.util.Collections.emptyList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private MaterialsData(
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();
species_ = rawValue;
break;
}
case 18: {
io.opencannabis.schema.product.struct.Genetics.Builder subBuilder = null;
if (genetics_ != null) {
subBuilder = genetics_.toBuilder();
}
genetics_ = input.readMessage(io.opencannabis.schema.product.struct.Genetics.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(genetics_);
genetics_ = subBuilder.buildPartial();
}
break;
}
case 24: {
int rawValue = input.readEnum();
grow_ = rawValue;
break;
}
case 32: {
int rawValue = input.readEnum();
shelf_ = rawValue;
break;
}
case 42: {
if (!((mutable_bitField0_ & 0x00000010) != 0)) {
channel_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000010;
}
channel_.add(
input.readMessage(io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.parser(), extensionRegistry));
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 {
if (((mutable_bitField0_ & 0x00000010) != 0)) {
channel_ = java.util.Collections.unmodifiableList(channel_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencannabis.schema.content.MaterialsContent.internal_static_opencannabis_content_MaterialsData_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.content.MaterialsContent.internal_static_opencannabis_content_MaterialsData_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.content.MaterialsContent.MaterialsData.class, io.opencannabis.schema.content.MaterialsContent.MaterialsData.Builder.class);
}
private int bitField0_;
public static final int SPECIES_FIELD_NUMBER = 1;
private int species_;
/**
*
* Species of an item, if known.
*
*
* .opencannabis.structs.Species species = 1;
*/
public int getSpeciesValue() {
return species_;
}
/**
*
* Species of an item, if known.
*
*
* .opencannabis.structs.Species species = 1;
*/
public io.opencannabis.schema.product.struct.Species getSpecies() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.Species result = io.opencannabis.schema.product.struct.Species.valueOf(species_);
return result == null ? io.opencannabis.schema.product.struct.Species.UNRECOGNIZED : result;
}
public static final int GENETICS_FIELD_NUMBER = 2;
private io.opencannabis.schema.product.struct.Genetics genetics_;
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public boolean hasGenetics() {
return genetics_ != null;
}
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public io.opencannabis.schema.product.struct.Genetics getGenetics() {
return genetics_ == null ? io.opencannabis.schema.product.struct.Genetics.getDefaultInstance() : genetics_;
}
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public io.opencannabis.schema.product.struct.GeneticsOrBuilder getGeneticsOrBuilder() {
return getGenetics();
}
public static final int GROW_FIELD_NUMBER = 3;
private int grow_;
/**
*
* Specifies how this item was grown.
*
*
* .opencannabis.structs.Grow grow = 3;
*/
public int getGrowValue() {
return grow_;
}
/**
*
* Specifies how this item was grown.
*
*
* .opencannabis.structs.Grow grow = 3;
*/
public io.opencannabis.schema.product.struct.Grow getGrow() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.Grow result = io.opencannabis.schema.product.struct.Grow.valueOf(grow_);
return result == null ? io.opencannabis.schema.product.struct.Grow.UNRECOGNIZED : result;
}
public static final int SHELF_FIELD_NUMBER = 4;
private int shelf_;
/**
*
* Shelf status of this product.
*
*
* .opencannabis.structs.Shelf shelf = 4;
*/
public int getShelfValue() {
return shelf_;
}
/**
*
* Shelf status of this product.
*
*
* .opencannabis.structs.Shelf shelf = 4;
*/
public io.opencannabis.schema.product.struct.Shelf getShelf() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.Shelf result = io.opencannabis.schema.product.struct.Shelf.valueOf(shelf_);
return result == null ? io.opencannabis.schema.product.struct.Shelf.UNRECOGNIZED : result;
}
public static final int CHANNEL_FIELD_NUMBER = 5;
private java.util.List channel_;
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public java.util.List getChannelList() {
return channel_;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public java.util.List extends io.opencannabis.schema.product.DistributionChannel.DistributionPolicyOrBuilder>
getChannelOrBuilderList() {
return channel_;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public int getChannelCount() {
return channel_.size();
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public io.opencannabis.schema.product.DistributionChannel.DistributionPolicy getChannel(int index) {
return channel_.get(index);
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public io.opencannabis.schema.product.DistributionChannel.DistributionPolicyOrBuilder getChannelOrBuilder(
int index) {
return channel_.get(index);
}
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 (species_ != io.opencannabis.schema.product.struct.Species.UNSPECIFIED.getNumber()) {
output.writeEnum(1, species_);
}
if (genetics_ != null) {
output.writeMessage(2, getGenetics());
}
if (grow_ != io.opencannabis.schema.product.struct.Grow.GENERIC.getNumber()) {
output.writeEnum(3, grow_);
}
if (shelf_ != io.opencannabis.schema.product.struct.Shelf.GENERIC_SHELF.getNumber()) {
output.writeEnum(4, shelf_);
}
for (int i = 0; i < channel_.size(); i++) {
output.writeMessage(5, channel_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (species_ != io.opencannabis.schema.product.struct.Species.UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, species_);
}
if (genetics_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getGenetics());
}
if (grow_ != io.opencannabis.schema.product.struct.Grow.GENERIC.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, grow_);
}
if (shelf_ != io.opencannabis.schema.product.struct.Shelf.GENERIC_SHELF.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(4, shelf_);
}
for (int i = 0; i < channel_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, channel_.get(i));
}
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.MaterialsContent.MaterialsData)) {
return super.equals(obj);
}
io.opencannabis.schema.content.MaterialsContent.MaterialsData other = (io.opencannabis.schema.content.MaterialsContent.MaterialsData) obj;
if (species_ != other.species_) return false;
if (hasGenetics() != other.hasGenetics()) return false;
if (hasGenetics()) {
if (!getGenetics()
.equals(other.getGenetics())) return false;
}
if (grow_ != other.grow_) return false;
if (shelf_ != other.shelf_) return false;
if (!getChannelList()
.equals(other.getChannelList())) return false;
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) + SPECIES_FIELD_NUMBER;
hash = (53 * hash) + species_;
if (hasGenetics()) {
hash = (37 * hash) + GENETICS_FIELD_NUMBER;
hash = (53 * hash) + getGenetics().hashCode();
}
hash = (37 * hash) + GROW_FIELD_NUMBER;
hash = (53 * hash) + grow_;
hash = (37 * hash) + SHELF_FIELD_NUMBER;
hash = (53 * hash) + shelf_;
if (getChannelCount() > 0) {
hash = (37 * hash) + CHANNEL_FIELD_NUMBER;
hash = (53 * hash) + getChannelList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.opencannabis.schema.content.MaterialsContent.MaterialsData parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.content.MaterialsContent.MaterialsData 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.MaterialsContent.MaterialsData parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.content.MaterialsContent.MaterialsData 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.MaterialsContent.MaterialsData parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.content.MaterialsContent.MaterialsData parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencannabis.schema.content.MaterialsContent.MaterialsData parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.content.MaterialsContent.MaterialsData 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.MaterialsContent.MaterialsData parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.opencannabis.schema.content.MaterialsContent.MaterialsData 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.MaterialsContent.MaterialsData parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.content.MaterialsContent.MaterialsData 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.MaterialsContent.MaterialsData 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 materials-related data about a product that contains cannabis.
*
*
* Protobuf type {@code opencannabis.content.MaterialsData}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:opencannabis.content.MaterialsData)
io.opencannabis.schema.content.MaterialsContent.MaterialsDataOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencannabis.schema.content.MaterialsContent.internal_static_opencannabis_content_MaterialsData_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.content.MaterialsContent.internal_static_opencannabis_content_MaterialsData_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.content.MaterialsContent.MaterialsData.class, io.opencannabis.schema.content.MaterialsContent.MaterialsData.Builder.class);
}
// Construct using io.opencannabis.schema.content.MaterialsContent.MaterialsData.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getChannelFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
species_ = 0;
if (geneticsBuilder_ == null) {
genetics_ = null;
} else {
genetics_ = null;
geneticsBuilder_ = null;
}
grow_ = 0;
shelf_ = 0;
if (channelBuilder_ == null) {
channel_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
} else {
channelBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.opencannabis.schema.content.MaterialsContent.internal_static_opencannabis_content_MaterialsData_descriptor;
}
@java.lang.Override
public io.opencannabis.schema.content.MaterialsContent.MaterialsData getDefaultInstanceForType() {
return io.opencannabis.schema.content.MaterialsContent.MaterialsData.getDefaultInstance();
}
@java.lang.Override
public io.opencannabis.schema.content.MaterialsContent.MaterialsData build() {
io.opencannabis.schema.content.MaterialsContent.MaterialsData result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.opencannabis.schema.content.MaterialsContent.MaterialsData buildPartial() {
io.opencannabis.schema.content.MaterialsContent.MaterialsData result = new io.opencannabis.schema.content.MaterialsContent.MaterialsData(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
result.species_ = species_;
if (geneticsBuilder_ == null) {
result.genetics_ = genetics_;
} else {
result.genetics_ = geneticsBuilder_.build();
}
result.grow_ = grow_;
result.shelf_ = shelf_;
if (channelBuilder_ == null) {
if (((bitField0_ & 0x00000010) != 0)) {
channel_ = java.util.Collections.unmodifiableList(channel_);
bitField0_ = (bitField0_ & ~0x00000010);
}
result.channel_ = channel_;
} else {
result.channel_ = channelBuilder_.build();
}
result.bitField0_ = to_bitField0_;
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.MaterialsContent.MaterialsData) {
return mergeFrom((io.opencannabis.schema.content.MaterialsContent.MaterialsData)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.opencannabis.schema.content.MaterialsContent.MaterialsData other) {
if (other == io.opencannabis.schema.content.MaterialsContent.MaterialsData.getDefaultInstance()) return this;
if (other.species_ != 0) {
setSpeciesValue(other.getSpeciesValue());
}
if (other.hasGenetics()) {
mergeGenetics(other.getGenetics());
}
if (other.grow_ != 0) {
setGrowValue(other.getGrowValue());
}
if (other.shelf_ != 0) {
setShelfValue(other.getShelfValue());
}
if (channelBuilder_ == null) {
if (!other.channel_.isEmpty()) {
if (channel_.isEmpty()) {
channel_ = other.channel_;
bitField0_ = (bitField0_ & ~0x00000010);
} else {
ensureChannelIsMutable();
channel_.addAll(other.channel_);
}
onChanged();
}
} else {
if (!other.channel_.isEmpty()) {
if (channelBuilder_.isEmpty()) {
channelBuilder_.dispose();
channelBuilder_ = null;
channel_ = other.channel_;
bitField0_ = (bitField0_ & ~0x00000010);
channelBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getChannelFieldBuilder() : null;
} else {
channelBuilder_.addAllMessages(other.channel_);
}
}
}
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.MaterialsContent.MaterialsData parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.opencannabis.schema.content.MaterialsContent.MaterialsData) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private int species_ = 0;
/**
*
* Species of an item, if known.
*
*
* .opencannabis.structs.Species species = 1;
*/
public int getSpeciesValue() {
return species_;
}
/**
*
* Species of an item, if known.
*
*
* .opencannabis.structs.Species species = 1;
*/
public Builder setSpeciesValue(int value) {
species_ = value;
onChanged();
return this;
}
/**
*
* Species of an item, if known.
*
*
* .opencannabis.structs.Species species = 1;
*/
public io.opencannabis.schema.product.struct.Species getSpecies() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.Species result = io.opencannabis.schema.product.struct.Species.valueOf(species_);
return result == null ? io.opencannabis.schema.product.struct.Species.UNRECOGNIZED : result;
}
/**
*
* Species of an item, if known.
*
*
* .opencannabis.structs.Species species = 1;
*/
public Builder setSpecies(io.opencannabis.schema.product.struct.Species value) {
if (value == null) {
throw new NullPointerException();
}
species_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Species of an item, if known.
*
*
* .opencannabis.structs.Species species = 1;
*/
public Builder clearSpecies() {
species_ = 0;
onChanged();
return this;
}
private io.opencannabis.schema.product.struct.Genetics genetics_;
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.product.struct.Genetics, io.opencannabis.schema.product.struct.Genetics.Builder, io.opencannabis.schema.product.struct.GeneticsOrBuilder> geneticsBuilder_;
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public boolean hasGenetics() {
return geneticsBuilder_ != null || genetics_ != null;
}
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public io.opencannabis.schema.product.struct.Genetics getGenetics() {
if (geneticsBuilder_ == null) {
return genetics_ == null ? io.opencannabis.schema.product.struct.Genetics.getDefaultInstance() : genetics_;
} else {
return geneticsBuilder_.getMessage();
}
}
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public Builder setGenetics(io.opencannabis.schema.product.struct.Genetics value) {
if (geneticsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
genetics_ = value;
onChanged();
} else {
geneticsBuilder_.setMessage(value);
}
return this;
}
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public Builder setGenetics(
io.opencannabis.schema.product.struct.Genetics.Builder builderForValue) {
if (geneticsBuilder_ == null) {
genetics_ = builderForValue.build();
onChanged();
} else {
geneticsBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public Builder mergeGenetics(io.opencannabis.schema.product.struct.Genetics value) {
if (geneticsBuilder_ == null) {
if (genetics_ != null) {
genetics_ =
io.opencannabis.schema.product.struct.Genetics.newBuilder(genetics_).mergeFrom(value).buildPartial();
} else {
genetics_ = value;
}
onChanged();
} else {
geneticsBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public Builder clearGenetics() {
if (geneticsBuilder_ == null) {
genetics_ = null;
onChanged();
} else {
genetics_ = null;
geneticsBuilder_ = null;
}
return this;
}
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public io.opencannabis.schema.product.struct.Genetics.Builder getGeneticsBuilder() {
onChanged();
return getGeneticsFieldBuilder().getBuilder();
}
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
public io.opencannabis.schema.product.struct.GeneticsOrBuilder getGeneticsOrBuilder() {
if (geneticsBuilder_ != null) {
return geneticsBuilder_.getMessageOrBuilder();
} else {
return genetics_ == null ?
io.opencannabis.schema.product.struct.Genetics.getDefaultInstance() : genetics_;
}
}
/**
*
* Specifies the genetics of an item, if known.
*
*
* .opencannabis.structs.Genetics genetics = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.product.struct.Genetics, io.opencannabis.schema.product.struct.Genetics.Builder, io.opencannabis.schema.product.struct.GeneticsOrBuilder>
getGeneticsFieldBuilder() {
if (geneticsBuilder_ == null) {
geneticsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.product.struct.Genetics, io.opencannabis.schema.product.struct.Genetics.Builder, io.opencannabis.schema.product.struct.GeneticsOrBuilder>(
getGenetics(),
getParentForChildren(),
isClean());
genetics_ = null;
}
return geneticsBuilder_;
}
private int grow_ = 0;
/**
*
* Specifies how this item was grown.
*
*
* .opencannabis.structs.Grow grow = 3;
*/
public int getGrowValue() {
return grow_;
}
/**
*
* Specifies how this item was grown.
*
*
* .opencannabis.structs.Grow grow = 3;
*/
public Builder setGrowValue(int value) {
grow_ = value;
onChanged();
return this;
}
/**
*
* Specifies how this item was grown.
*
*
* .opencannabis.structs.Grow grow = 3;
*/
public io.opencannabis.schema.product.struct.Grow getGrow() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.Grow result = io.opencannabis.schema.product.struct.Grow.valueOf(grow_);
return result == null ? io.opencannabis.schema.product.struct.Grow.UNRECOGNIZED : result;
}
/**
*
* Specifies how this item was grown.
*
*
* .opencannabis.structs.Grow grow = 3;
*/
public Builder setGrow(io.opencannabis.schema.product.struct.Grow value) {
if (value == null) {
throw new NullPointerException();
}
grow_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Specifies how this item was grown.
*
*
* .opencannabis.structs.Grow grow = 3;
*/
public Builder clearGrow() {
grow_ = 0;
onChanged();
return this;
}
private int shelf_ = 0;
/**
*
* Shelf status of this product.
*
*
* .opencannabis.structs.Shelf shelf = 4;
*/
public int getShelfValue() {
return shelf_;
}
/**
*
* Shelf status of this product.
*
*
* .opencannabis.structs.Shelf shelf = 4;
*/
public Builder setShelfValue(int value) {
shelf_ = value;
onChanged();
return this;
}
/**
*
* Shelf status of this product.
*
*
* .opencannabis.structs.Shelf shelf = 4;
*/
public io.opencannabis.schema.product.struct.Shelf getShelf() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.Shelf result = io.opencannabis.schema.product.struct.Shelf.valueOf(shelf_);
return result == null ? io.opencannabis.schema.product.struct.Shelf.UNRECOGNIZED : result;
}
/**
*
* Shelf status of this product.
*
*
* .opencannabis.structs.Shelf shelf = 4;
*/
public Builder setShelf(io.opencannabis.schema.product.struct.Shelf value) {
if (value == null) {
throw new NullPointerException();
}
shelf_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Shelf status of this product.
*
*
* .opencannabis.structs.Shelf shelf = 4;
*/
public Builder clearShelf() {
shelf_ = 0;
onChanged();
return this;
}
private java.util.List channel_ =
java.util.Collections.emptyList();
private void ensureChannelIsMutable() {
if (!((bitField0_ & 0x00000010) != 0)) {
channel_ = new java.util.ArrayList(channel_);
bitField0_ |= 0x00000010;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.opencannabis.schema.product.DistributionChannel.DistributionPolicy, io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.Builder, io.opencannabis.schema.product.DistributionChannel.DistributionPolicyOrBuilder> channelBuilder_;
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public java.util.List getChannelList() {
if (channelBuilder_ == null) {
return java.util.Collections.unmodifiableList(channel_);
} else {
return channelBuilder_.getMessageList();
}
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public int getChannelCount() {
if (channelBuilder_ == null) {
return channel_.size();
} else {
return channelBuilder_.getCount();
}
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public io.opencannabis.schema.product.DistributionChannel.DistributionPolicy getChannel(int index) {
if (channelBuilder_ == null) {
return channel_.get(index);
} else {
return channelBuilder_.getMessage(index);
}
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public Builder setChannel(
int index, io.opencannabis.schema.product.DistributionChannel.DistributionPolicy value) {
if (channelBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureChannelIsMutable();
channel_.set(index, value);
onChanged();
} else {
channelBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public Builder setChannel(
int index, io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.Builder builderForValue) {
if (channelBuilder_ == null) {
ensureChannelIsMutable();
channel_.set(index, builderForValue.build());
onChanged();
} else {
channelBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public Builder addChannel(io.opencannabis.schema.product.DistributionChannel.DistributionPolicy value) {
if (channelBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureChannelIsMutable();
channel_.add(value);
onChanged();
} else {
channelBuilder_.addMessage(value);
}
return this;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public Builder addChannel(
int index, io.opencannabis.schema.product.DistributionChannel.DistributionPolicy value) {
if (channelBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureChannelIsMutable();
channel_.add(index, value);
onChanged();
} else {
channelBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public Builder addChannel(
io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.Builder builderForValue) {
if (channelBuilder_ == null) {
ensureChannelIsMutable();
channel_.add(builderForValue.build());
onChanged();
} else {
channelBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public Builder addChannel(
int index, io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.Builder builderForValue) {
if (channelBuilder_ == null) {
ensureChannelIsMutable();
channel_.add(index, builderForValue.build());
onChanged();
} else {
channelBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public Builder addAllChannel(
java.lang.Iterable extends io.opencannabis.schema.product.DistributionChannel.DistributionPolicy> values) {
if (channelBuilder_ == null) {
ensureChannelIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, channel_);
onChanged();
} else {
channelBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public Builder clearChannel() {
if (channelBuilder_ == null) {
channel_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
} else {
channelBuilder_.clear();
}
return this;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public Builder removeChannel(int index) {
if (channelBuilder_ == null) {
ensureChannelIsMutable();
channel_.remove(index);
onChanged();
} else {
channelBuilder_.remove(index);
}
return this;
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.Builder getChannelBuilder(
int index) {
return getChannelFieldBuilder().getBuilder(index);
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public io.opencannabis.schema.product.DistributionChannel.DistributionPolicyOrBuilder getChannelOrBuilder(
int index) {
if (channelBuilder_ == null) {
return channel_.get(index); } else {
return channelBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public java.util.List extends io.opencannabis.schema.product.DistributionChannel.DistributionPolicyOrBuilder>
getChannelOrBuilderList() {
if (channelBuilder_ != null) {
return channelBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(channel_);
}
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.Builder addChannelBuilder() {
return getChannelFieldBuilder().addBuilder(
io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.getDefaultInstance());
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.Builder addChannelBuilder(
int index) {
return getChannelFieldBuilder().addBuilder(
index, io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.getDefaultInstance());
}
/**
*
* Specifies distribution policy for this particular subject material.
*
*
* repeated .opencannabis.products.distribution.DistributionPolicy channel = 5;
*/
public java.util.List
getChannelBuilderList() {
return getChannelFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.opencannabis.schema.product.DistributionChannel.DistributionPolicy, io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.Builder, io.opencannabis.schema.product.DistributionChannel.DistributionPolicyOrBuilder>
getChannelFieldBuilder() {
if (channelBuilder_ == null) {
channelBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
io.opencannabis.schema.product.DistributionChannel.DistributionPolicy, io.opencannabis.schema.product.DistributionChannel.DistributionPolicy.Builder, io.opencannabis.schema.product.DistributionChannel.DistributionPolicyOrBuilder>(
channel_,
((bitField0_ & 0x00000010) != 0),
getParentForChildren(),
isClean());
channel_ = null;
}
return channelBuilder_;
}
@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.MaterialsData)
}
// @@protoc_insertion_point(class_scope:opencannabis.content.MaterialsData)
private static final io.opencannabis.schema.content.MaterialsContent.MaterialsData DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.opencannabis.schema.content.MaterialsContent.MaterialsData();
}
public static io.opencannabis.schema.content.MaterialsContent.MaterialsData getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public MaterialsData parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MaterialsData(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.MaterialsContent.MaterialsData getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_opencannabis_content_MaterialsData_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_opencannabis_content_MaterialsData_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\033content/MaterialsData.proto\022\024opencanna" +
"bis.content\032\022structs/Grow.proto\032\023structs" +
"/Shelf.proto\032\025structs/Species.proto\032\026str" +
"ucts/Genetics.proto\032/products/distributi" +
"on/DistributionChannel.proto\"\220\002\n\rMateria" +
"lsData\022.\n\007species\030\001 \001(\0162\035.opencannabis.s" +
"tructs.Species\0220\n\010genetics\030\002 \001(\0132\036.openc" +
"annabis.structs.Genetics\022(\n\004grow\030\003 \001(\0162\032" +
".opencannabis.structs.Grow\022*\n\005shelf\030\004 \001(" +
"\0162\033.opencannabis.structs.Shelf\022G\n\007channe" +
"l\030\005 \003(\01326.opencannabis.products.distribu" +
"tion.DistributionPolicyB<\n\036io.opencannab" +
"is.schema.contentB\020MaterialsContentH\001P\000\242" +
"\002\003OCSb\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[] {
io.opencannabis.schema.product.struct.MaterialGrow.getDescriptor(),
io.opencannabis.schema.product.struct.MaterialShelf.getDescriptor(),
io.opencannabis.schema.product.struct.MaterialSpecies.getDescriptor(),
io.opencannabis.schema.product.struct.GeneticsStructs.getDescriptor(),
io.opencannabis.schema.product.DistributionChannel.getDescriptor(),
}, assigner);
internal_static_opencannabis_content_MaterialsData_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_opencannabis_content_MaterialsData_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_opencannabis_content_MaterialsData_descriptor,
new java.lang.String[] { "Species", "Genetics", "Grow", "Shelf", "Channel", });
io.opencannabis.schema.product.struct.MaterialGrow.getDescriptor();
io.opencannabis.schema.product.struct.MaterialShelf.getDescriptor();
io.opencannabis.schema.product.struct.MaterialSpecies.getDescriptor();
io.opencannabis.schema.product.struct.GeneticsStructs.getDescriptor();
io.opencannabis.schema.product.DistributionChannel.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy