io.opencannabis.schema.commerce.OrderItem 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: commerce/Item.proto
package io.opencannabis.schema.commerce;
public final class OrderItem {
private OrderItem() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
/**
*
* Specifies weight and price of ordered product
*
*
* Protobuf enum {@code opencannabis.commerce.ProductVariant}
*/
public enum ProductVariant
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Variance by product weight.
*
*
* WEIGHT = 0;
*/
WEIGHT(0),
/**
*
* Variance by product color.
*
*
* COLOR = 1;
*/
COLOR(1),
/**
*
* Variance by product size.
*
*
* SIZE = 2;
*/
SIZE(2),
UNRECOGNIZED(-1),
;
/**
*
* Variance by product weight.
*
*
* WEIGHT = 0;
*/
public static final int WEIGHT_VALUE = 0;
/**
*
* Variance by product color.
*
*
* COLOR = 1;
*/
public static final int COLOR_VALUE = 1;
/**
*
* Variance by product size.
*
*
* SIZE = 2;
*/
public static final int SIZE_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 ProductVariant valueOf(int value) {
return forNumber(value);
}
public static ProductVariant forNumber(int value) {
switch (value) {
case 0: return WEIGHT;
case 1: return COLOR;
case 2: return SIZE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
ProductVariant> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public ProductVariant findValueByNumber(int number) {
return ProductVariant.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.commerce.OrderItem.getDescriptor().getEnumTypes().get(0);
}
private static final ProductVariant[] VALUES = values();
public static ProductVariant 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 ProductVariant(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:opencannabis.commerce.ProductVariant)
}
public interface VariantSpecOrBuilder extends
// @@protoc_insertion_point(interface_extends:opencannabis.commerce.VariantSpec)
com.google.protobuf.MessageOrBuilder {
/**
*
* Specifies the variance type for this spec.
*
*
* .opencannabis.commerce.ProductVariant variant = 1;
*/
int getVariantValue();
/**
*
* Specifies the variance type for this spec.
*
*
* .opencannabis.commerce.ProductVariant variant = 1;
*/
io.opencannabis.schema.commerce.OrderItem.ProductVariant getVariant();
/**
*
* Specifies a product weight, when varying by weight.
*
*
* .opencannabis.structs.pricing.PricingWeightTier weight = 2;
*/
int getWeightValue();
/**
*
* Specifies a product weight, when varying by weight.
*
*
* .opencannabis.structs.pricing.PricingWeightTier weight = 2;
*/
io.opencannabis.schema.product.struct.PricingWeightTier getWeight();
/**
*
* Specifies a size option for the product.
*
*
* string size = 3;
*/
java.lang.String getSize();
/**
*
* Specifies a size option for the product.
*
*
* string size = 3;
*/
com.google.protobuf.ByteString
getSizeBytes();
/**
*
* Specifies a color option for the product.
*
*
* string color = 4;
*/
java.lang.String getColor();
/**
*
* Specifies a color option for the product.
*
*
* string color = 4;
*/
com.google.protobuf.ByteString
getColorBytes();
public io.opencannabis.schema.commerce.OrderItem.VariantSpec.SpecCase getSpecCase();
}
/**
*
* Specifies if it is a weighted product or a unit priced product and attaches that to item.
*
*
* Protobuf type {@code opencannabis.commerce.VariantSpec}
*/
public static final class VariantSpec extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:opencannabis.commerce.VariantSpec)
VariantSpecOrBuilder {
private static final long serialVersionUID = 0L;
// Use VariantSpec.newBuilder() to construct.
private VariantSpec(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private VariantSpec() {
variant_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private VariantSpec(
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();
variant_ = rawValue;
break;
}
case 16: {
int rawValue = input.readEnum();
specCase_ = 2;
spec_ = rawValue;
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
specCase_ = 3;
spec_ = s;
break;
}
case 34: {
java.lang.String s = input.readStringRequireUtf8();
specCase_ = 4;
spec_ = 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.opencannabis.schema.commerce.OrderItem.internal_static_opencannabis_commerce_VariantSpec_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.commerce.OrderItem.internal_static_opencannabis_commerce_VariantSpec_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.commerce.OrderItem.VariantSpec.class, io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder.class);
}
private int specCase_ = 0;
private java.lang.Object spec_;
public enum SpecCase
implements com.google.protobuf.Internal.EnumLite {
WEIGHT(2),
SIZE(3),
COLOR(4),
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 WEIGHT;
case 3: return SIZE;
case 4: return COLOR;
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 VARIANT_FIELD_NUMBER = 1;
private int variant_;
/**
*
* Specifies the variance type for this spec.
*
*
* .opencannabis.commerce.ProductVariant variant = 1;
*/
public int getVariantValue() {
return variant_;
}
/**
*
* Specifies the variance type for this spec.
*
*
* .opencannabis.commerce.ProductVariant variant = 1;
*/
public io.opencannabis.schema.commerce.OrderItem.ProductVariant getVariant() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.commerce.OrderItem.ProductVariant result = io.opencannabis.schema.commerce.OrderItem.ProductVariant.valueOf(variant_);
return result == null ? io.opencannabis.schema.commerce.OrderItem.ProductVariant.UNRECOGNIZED : result;
}
public static final int WEIGHT_FIELD_NUMBER = 2;
/**
*
* Specifies a product weight, when varying by weight.
*
*
* .opencannabis.structs.pricing.PricingWeightTier weight = 2;
*/
public int getWeightValue() {
if (specCase_ == 2) {
return (java.lang.Integer) spec_;
}
return 0;
}
/**
*
* Specifies a product weight, when varying by weight.
*
*
* .opencannabis.structs.pricing.PricingWeightTier weight = 2;
*/
public io.opencannabis.schema.product.struct.PricingWeightTier getWeight() {
if (specCase_ == 2) {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.PricingWeightTier result = io.opencannabis.schema.product.struct.PricingWeightTier.valueOf(
(java.lang.Integer) spec_);
return result == null ? io.opencannabis.schema.product.struct.PricingWeightTier.UNRECOGNIZED : result;
}
return io.opencannabis.schema.product.struct.PricingWeightTier.NO_WEIGHT;
}
public static final int SIZE_FIELD_NUMBER = 3;
/**
*
* Specifies a size option for the product.
*
*
* string size = 3;
*/
public java.lang.String getSize() {
java.lang.Object ref = "";
if (specCase_ == 3) {
ref = spec_;
}
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 (specCase_ == 3) {
spec_ = s;
}
return s;
}
}
/**
*
* Specifies a size option for the product.
*
*
* string size = 3;
*/
public com.google.protobuf.ByteString
getSizeBytes() {
java.lang.Object ref = "";
if (specCase_ == 3) {
ref = spec_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (specCase_ == 3) {
spec_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int COLOR_FIELD_NUMBER = 4;
/**
*
* Specifies a color option for the product.
*
*
* string color = 4;
*/
public java.lang.String getColor() {
java.lang.Object ref = "";
if (specCase_ == 4) {
ref = spec_;
}
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 (specCase_ == 4) {
spec_ = s;
}
return s;
}
}
/**
*
* Specifies a color option for the product.
*
*
* string color = 4;
*/
public com.google.protobuf.ByteString
getColorBytes() {
java.lang.Object ref = "";
if (specCase_ == 4) {
ref = spec_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (specCase_ == 4) {
spec_ = 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 (variant_ != io.opencannabis.schema.commerce.OrderItem.ProductVariant.WEIGHT.getNumber()) {
output.writeEnum(1, variant_);
}
if (specCase_ == 2) {
output.writeEnum(2, ((java.lang.Integer) spec_));
}
if (specCase_ == 3) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, spec_);
}
if (specCase_ == 4) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, spec_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (variant_ != io.opencannabis.schema.commerce.OrderItem.ProductVariant.WEIGHT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, variant_);
}
if (specCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, ((java.lang.Integer) spec_));
}
if (specCase_ == 3) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, spec_);
}
if (specCase_ == 4) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, spec_);
}
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.commerce.OrderItem.VariantSpec)) {
return super.equals(obj);
}
io.opencannabis.schema.commerce.OrderItem.VariantSpec other = (io.opencannabis.schema.commerce.OrderItem.VariantSpec) obj;
if (variant_ != other.variant_) return false;
if (!getSpecCase().equals(other.getSpecCase())) return false;
switch (specCase_) {
case 2:
if (getWeightValue()
!= other.getWeightValue()) return false;
break;
case 3:
if (!getSize()
.equals(other.getSize())) return false;
break;
case 4:
if (!getColor()
.equals(other.getColor())) 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) + VARIANT_FIELD_NUMBER;
hash = (53 * hash) + variant_;
switch (specCase_) {
case 2:
hash = (37 * hash) + WEIGHT_FIELD_NUMBER;
hash = (53 * hash) + getWeightValue();
break;
case 3:
hash = (37 * hash) + SIZE_FIELD_NUMBER;
hash = (53 * hash) + getSize().hashCode();
break;
case 4:
hash = (37 * hash) + COLOR_FIELD_NUMBER;
hash = (53 * hash) + getColor().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.opencannabis.schema.commerce.OrderItem.VariantSpec parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.commerce.OrderItem.VariantSpec 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.commerce.OrderItem.VariantSpec parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.commerce.OrderItem.VariantSpec 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.commerce.OrderItem.VariantSpec parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.commerce.OrderItem.VariantSpec parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencannabis.schema.commerce.OrderItem.VariantSpec parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.commerce.OrderItem.VariantSpec 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.commerce.OrderItem.VariantSpec parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.opencannabis.schema.commerce.OrderItem.VariantSpec 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.commerce.OrderItem.VariantSpec parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.commerce.OrderItem.VariantSpec 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.commerce.OrderItem.VariantSpec 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 if it is a weighted product or a unit priced product and attaches that to item.
*
*
* Protobuf type {@code opencannabis.commerce.VariantSpec}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:opencannabis.commerce.VariantSpec)
io.opencannabis.schema.commerce.OrderItem.VariantSpecOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencannabis.schema.commerce.OrderItem.internal_static_opencannabis_commerce_VariantSpec_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.commerce.OrderItem.internal_static_opencannabis_commerce_VariantSpec_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.commerce.OrderItem.VariantSpec.class, io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder.class);
}
// Construct using io.opencannabis.schema.commerce.OrderItem.VariantSpec.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();
variant_ = 0;
specCase_ = 0;
spec_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.opencannabis.schema.commerce.OrderItem.internal_static_opencannabis_commerce_VariantSpec_descriptor;
}
@java.lang.Override
public io.opencannabis.schema.commerce.OrderItem.VariantSpec getDefaultInstanceForType() {
return io.opencannabis.schema.commerce.OrderItem.VariantSpec.getDefaultInstance();
}
@java.lang.Override
public io.opencannabis.schema.commerce.OrderItem.VariantSpec build() {
io.opencannabis.schema.commerce.OrderItem.VariantSpec result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.opencannabis.schema.commerce.OrderItem.VariantSpec buildPartial() {
io.opencannabis.schema.commerce.OrderItem.VariantSpec result = new io.opencannabis.schema.commerce.OrderItem.VariantSpec(this);
result.variant_ = variant_;
if (specCase_ == 2) {
result.spec_ = spec_;
}
if (specCase_ == 3) {
result.spec_ = spec_;
}
if (specCase_ == 4) {
result.spec_ = spec_;
}
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.opencannabis.schema.commerce.OrderItem.VariantSpec) {
return mergeFrom((io.opencannabis.schema.commerce.OrderItem.VariantSpec)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.opencannabis.schema.commerce.OrderItem.VariantSpec other) {
if (other == io.opencannabis.schema.commerce.OrderItem.VariantSpec.getDefaultInstance()) return this;
if (other.variant_ != 0) {
setVariantValue(other.getVariantValue());
}
switch (other.getSpecCase()) {
case WEIGHT: {
setWeightValue(other.getWeightValue());
break;
}
case SIZE: {
specCase_ = 3;
spec_ = other.spec_;
onChanged();
break;
}
case COLOR: {
specCase_ = 4;
spec_ = other.spec_;
onChanged();
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.opencannabis.schema.commerce.OrderItem.VariantSpec parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.opencannabis.schema.commerce.OrderItem.VariantSpec) 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 int variant_ = 0;
/**
*
* Specifies the variance type for this spec.
*
*
* .opencannabis.commerce.ProductVariant variant = 1;
*/
public int getVariantValue() {
return variant_;
}
/**
*
* Specifies the variance type for this spec.
*
*
* .opencannabis.commerce.ProductVariant variant = 1;
*/
public Builder setVariantValue(int value) {
variant_ = value;
onChanged();
return this;
}
/**
*
* Specifies the variance type for this spec.
*
*
* .opencannabis.commerce.ProductVariant variant = 1;
*/
public io.opencannabis.schema.commerce.OrderItem.ProductVariant getVariant() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.commerce.OrderItem.ProductVariant result = io.opencannabis.schema.commerce.OrderItem.ProductVariant.valueOf(variant_);
return result == null ? io.opencannabis.schema.commerce.OrderItem.ProductVariant.UNRECOGNIZED : result;
}
/**
*
* Specifies the variance type for this spec.
*
*
* .opencannabis.commerce.ProductVariant variant = 1;
*/
public Builder setVariant(io.opencannabis.schema.commerce.OrderItem.ProductVariant value) {
if (value == null) {
throw new NullPointerException();
}
variant_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Specifies the variance type for this spec.
*
*
* .opencannabis.commerce.ProductVariant variant = 1;
*/
public Builder clearVariant() {
variant_ = 0;
onChanged();
return this;
}
/**
*
* Specifies a product weight, when varying by weight.
*
*
* .opencannabis.structs.pricing.PricingWeightTier weight = 2;
*/
public int getWeightValue() {
if (specCase_ == 2) {
return ((java.lang.Integer) spec_).intValue();
}
return 0;
}
/**
*
* Specifies a product weight, when varying by weight.
*
*
* .opencannabis.structs.pricing.PricingWeightTier weight = 2;
*/
public Builder setWeightValue(int value) {
specCase_ = 2;
spec_ = value;
onChanged();
return this;
}
/**
*
* Specifies a product weight, when varying by weight.
*
*
* .opencannabis.structs.pricing.PricingWeightTier weight = 2;
*/
public io.opencannabis.schema.product.struct.PricingWeightTier getWeight() {
if (specCase_ == 2) {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.PricingWeightTier result = io.opencannabis.schema.product.struct.PricingWeightTier.valueOf(
(java.lang.Integer) spec_);
return result == null ? io.opencannabis.schema.product.struct.PricingWeightTier.UNRECOGNIZED : result;
}
return io.opencannabis.schema.product.struct.PricingWeightTier.NO_WEIGHT;
}
/**
*
* Specifies a product weight, when varying by weight.
*
*
* .opencannabis.structs.pricing.PricingWeightTier weight = 2;
*/
public Builder setWeight(io.opencannabis.schema.product.struct.PricingWeightTier value) {
if (value == null) {
throw new NullPointerException();
}
specCase_ = 2;
spec_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Specifies a product weight, when varying by weight.
*
*
* .opencannabis.structs.pricing.PricingWeightTier weight = 2;
*/
public Builder clearWeight() {
if (specCase_ == 2) {
specCase_ = 0;
spec_ = null;
onChanged();
}
return this;
}
/**
*
* Specifies a size option for the product.
*
*
* string size = 3;
*/
public java.lang.String getSize() {
java.lang.Object ref = "";
if (specCase_ == 3) {
ref = spec_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (specCase_ == 3) {
spec_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Specifies a size option for the product.
*
*
* string size = 3;
*/
public com.google.protobuf.ByteString
getSizeBytes() {
java.lang.Object ref = "";
if (specCase_ == 3) {
ref = spec_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (specCase_ == 3) {
spec_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Specifies a size option for the product.
*
*
* string size = 3;
*/
public Builder setSize(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
specCase_ = 3;
spec_ = value;
onChanged();
return this;
}
/**
*
* Specifies a size option for the product.
*
*
* string size = 3;
*/
public Builder clearSize() {
if (specCase_ == 3) {
specCase_ = 0;
spec_ = null;
onChanged();
}
return this;
}
/**
*
* Specifies a size option for the product.
*
*
* string size = 3;
*/
public Builder setSizeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
specCase_ = 3;
spec_ = value;
onChanged();
return this;
}
/**
*
* Specifies a color option for the product.
*
*
* string color = 4;
*/
public java.lang.String getColor() {
java.lang.Object ref = "";
if (specCase_ == 4) {
ref = spec_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (specCase_ == 4) {
spec_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Specifies a color option for the product.
*
*
* string color = 4;
*/
public com.google.protobuf.ByteString
getColorBytes() {
java.lang.Object ref = "";
if (specCase_ == 4) {
ref = spec_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (specCase_ == 4) {
spec_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Specifies a color option for the product.
*
*
* string color = 4;
*/
public Builder setColor(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
specCase_ = 4;
spec_ = value;
onChanged();
return this;
}
/**
*
* Specifies a color option for the product.
*
*
* string color = 4;
*/
public Builder clearColor() {
if (specCase_ == 4) {
specCase_ = 0;
spec_ = null;
onChanged();
}
return this;
}
/**
*
* Specifies a color option for the product.
*
*
* string color = 4;
*/
public Builder setColorBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
specCase_ = 4;
spec_ = 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:opencannabis.commerce.VariantSpec)
}
// @@protoc_insertion_point(class_scope:opencannabis.commerce.VariantSpec)
private static final io.opencannabis.schema.commerce.OrderItem.VariantSpec DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.opencannabis.schema.commerce.OrderItem.VariantSpec();
}
public static io.opencannabis.schema.commerce.OrderItem.VariantSpec getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public VariantSpec parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new VariantSpec(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.commerce.OrderItem.VariantSpec getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface ItemOrBuilder extends
// @@protoc_insertion_point(interface_extends:opencannabis.commerce.Item)
com.google.protobuf.MessageOrBuilder {
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
boolean hasKey();
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
io.opencannabis.schema.base.BaseProductKey.ProductKey getKey();
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
io.opencannabis.schema.base.BaseProductKey.ProductKeyOrBuilder getKeyOrBuilder();
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
java.util.List
getVariantList();
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
io.opencannabis.schema.commerce.OrderItem.VariantSpec getVariant(int index);
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
int getVariantCount();
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
java.util.List extends io.opencannabis.schema.commerce.OrderItem.VariantSpecOrBuilder>
getVariantOrBuilderList();
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
io.opencannabis.schema.commerce.OrderItem.VariantSpecOrBuilder getVariantOrBuilder(
int index);
/**
*
* Count of this item requested.
*
*
* uint32 count = 3;
*/
int getCount();
/**
*
* Detail/link URL for this item.
*
*
* string uri = 4;
*/
java.lang.String getUri();
/**
*
* Detail/link URL for this item.
*
*
* string uri = 4;
*/
com.google.protobuf.ByteString
getUriBytes();
/**
*
* Image URL for this item.
*
*
* string image_uri = 5;
*/
java.lang.String getImageUri();
/**
*
* Image URL for this item.
*
*
* string image_uri = 5;
*/
com.google.protobuf.ByteString
getImageUriBytes();
}
/**
*
* Specifies the Item via the product key as well as weight, and count of product ordered
*
*
* Protobuf type {@code opencannabis.commerce.Item}
*/
public static final class Item extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:opencannabis.commerce.Item)
ItemOrBuilder {
private static final long serialVersionUID = 0L;
// Use Item.newBuilder() to construct.
private Item(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Item() {
variant_ = java.util.Collections.emptyList();
uri_ = "";
imageUri_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Item(
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.base.BaseProductKey.ProductKey.Builder subBuilder = null;
if (key_ != null) {
subBuilder = key_.toBuilder();
}
key_ = input.readMessage(io.opencannabis.schema.base.BaseProductKey.ProductKey.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(key_);
key_ = subBuilder.buildPartial();
}
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
variant_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000002;
}
variant_.add(
input.readMessage(io.opencannabis.schema.commerce.OrderItem.VariantSpec.parser(), extensionRegistry));
break;
}
case 24: {
count_ = input.readUInt32();
break;
}
case 34: {
java.lang.String s = input.readStringRequireUtf8();
uri_ = s;
break;
}
case 42: {
java.lang.String s = input.readStringRequireUtf8();
imageUri_ = 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 {
if (((mutable_bitField0_ & 0x00000002) != 0)) {
variant_ = java.util.Collections.unmodifiableList(variant_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencannabis.schema.commerce.OrderItem.internal_static_opencannabis_commerce_Item_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.commerce.OrderItem.internal_static_opencannabis_commerce_Item_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.commerce.OrderItem.Item.class, io.opencannabis.schema.commerce.OrderItem.Item.Builder.class);
}
private int bitField0_;
public static final int KEY_FIELD_NUMBER = 1;
private io.opencannabis.schema.base.BaseProductKey.ProductKey key_;
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public boolean hasKey() {
return key_ != null;
}
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public io.opencannabis.schema.base.BaseProductKey.ProductKey getKey() {
return key_ == null ? io.opencannabis.schema.base.BaseProductKey.ProductKey.getDefaultInstance() : key_;
}
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public io.opencannabis.schema.base.BaseProductKey.ProductKeyOrBuilder getKeyOrBuilder() {
return getKey();
}
public static final int VARIANT_FIELD_NUMBER = 2;
private java.util.List variant_;
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public java.util.List getVariantList() {
return variant_;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public java.util.List extends io.opencannabis.schema.commerce.OrderItem.VariantSpecOrBuilder>
getVariantOrBuilderList() {
return variant_;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public int getVariantCount() {
return variant_.size();
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public io.opencannabis.schema.commerce.OrderItem.VariantSpec getVariant(int index) {
return variant_.get(index);
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public io.opencannabis.schema.commerce.OrderItem.VariantSpecOrBuilder getVariantOrBuilder(
int index) {
return variant_.get(index);
}
public static final int COUNT_FIELD_NUMBER = 3;
private int count_;
/**
*
* Count of this item requested.
*
*
* uint32 count = 3;
*/
public int getCount() {
return count_;
}
public static final int URI_FIELD_NUMBER = 4;
private volatile java.lang.Object uri_;
/**
*
* Detail/link URL for this item.
*
*
* string uri = 4;
*/
public java.lang.String getUri() {
java.lang.Object ref = uri_;
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();
uri_ = s;
return s;
}
}
/**
*
* Detail/link URL for this item.
*
*
* string uri = 4;
*/
public com.google.protobuf.ByteString
getUriBytes() {
java.lang.Object ref = uri_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
uri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int IMAGE_URI_FIELD_NUMBER = 5;
private volatile java.lang.Object imageUri_;
/**
*
* Image URL for this item.
*
*
* string image_uri = 5;
*/
public java.lang.String getImageUri() {
java.lang.Object ref = imageUri_;
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();
imageUri_ = s;
return s;
}
}
/**
*
* Image URL for this item.
*
*
* string image_uri = 5;
*/
public com.google.protobuf.ByteString
getImageUriBytes() {
java.lang.Object ref = imageUri_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
imageUri_ = 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 (key_ != null) {
output.writeMessage(1, getKey());
}
for (int i = 0; i < variant_.size(); i++) {
output.writeMessage(2, variant_.get(i));
}
if (count_ != 0) {
output.writeUInt32(3, count_);
}
if (!getUriBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, uri_);
}
if (!getImageUriBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, imageUri_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (key_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getKey());
}
for (int i = 0; i < variant_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, variant_.get(i));
}
if (count_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, count_);
}
if (!getUriBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, uri_);
}
if (!getImageUriBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, imageUri_);
}
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.commerce.OrderItem.Item)) {
return super.equals(obj);
}
io.opencannabis.schema.commerce.OrderItem.Item other = (io.opencannabis.schema.commerce.OrderItem.Item) obj;
if (hasKey() != other.hasKey()) return false;
if (hasKey()) {
if (!getKey()
.equals(other.getKey())) return false;
}
if (!getVariantList()
.equals(other.getVariantList())) return false;
if (getCount()
!= other.getCount()) return false;
if (!getUri()
.equals(other.getUri())) return false;
if (!getImageUri()
.equals(other.getImageUri())) 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();
if (hasKey()) {
hash = (37 * hash) + KEY_FIELD_NUMBER;
hash = (53 * hash) + getKey().hashCode();
}
if (getVariantCount() > 0) {
hash = (37 * hash) + VARIANT_FIELD_NUMBER;
hash = (53 * hash) + getVariantList().hashCode();
}
hash = (37 * hash) + COUNT_FIELD_NUMBER;
hash = (53 * hash) + getCount();
hash = (37 * hash) + URI_FIELD_NUMBER;
hash = (53 * hash) + getUri().hashCode();
hash = (37 * hash) + IMAGE_URI_FIELD_NUMBER;
hash = (53 * hash) + getImageUri().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.opencannabis.schema.commerce.OrderItem.Item parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.commerce.OrderItem.Item 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.commerce.OrderItem.Item parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.commerce.OrderItem.Item 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.commerce.OrderItem.Item parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.commerce.OrderItem.Item parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencannabis.schema.commerce.OrderItem.Item parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.commerce.OrderItem.Item 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.commerce.OrderItem.Item parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.opencannabis.schema.commerce.OrderItem.Item 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.commerce.OrderItem.Item parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.commerce.OrderItem.Item 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.commerce.OrderItem.Item 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 the Item via the product key as well as weight, and count of product ordered
*
*
* Protobuf type {@code opencannabis.commerce.Item}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:opencannabis.commerce.Item)
io.opencannabis.schema.commerce.OrderItem.ItemOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencannabis.schema.commerce.OrderItem.internal_static_opencannabis_commerce_Item_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.commerce.OrderItem.internal_static_opencannabis_commerce_Item_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.commerce.OrderItem.Item.class, io.opencannabis.schema.commerce.OrderItem.Item.Builder.class);
}
// Construct using io.opencannabis.schema.commerce.OrderItem.Item.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getVariantFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (keyBuilder_ == null) {
key_ = null;
} else {
key_ = null;
keyBuilder_ = null;
}
if (variantBuilder_ == null) {
variant_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
variantBuilder_.clear();
}
count_ = 0;
uri_ = "";
imageUri_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.opencannabis.schema.commerce.OrderItem.internal_static_opencannabis_commerce_Item_descriptor;
}
@java.lang.Override
public io.opencannabis.schema.commerce.OrderItem.Item getDefaultInstanceForType() {
return io.opencannabis.schema.commerce.OrderItem.Item.getDefaultInstance();
}
@java.lang.Override
public io.opencannabis.schema.commerce.OrderItem.Item build() {
io.opencannabis.schema.commerce.OrderItem.Item result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.opencannabis.schema.commerce.OrderItem.Item buildPartial() {
io.opencannabis.schema.commerce.OrderItem.Item result = new io.opencannabis.schema.commerce.OrderItem.Item(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (keyBuilder_ == null) {
result.key_ = key_;
} else {
result.key_ = keyBuilder_.build();
}
if (variantBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
variant_ = java.util.Collections.unmodifiableList(variant_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.variant_ = variant_;
} else {
result.variant_ = variantBuilder_.build();
}
result.count_ = count_;
result.uri_ = uri_;
result.imageUri_ = imageUri_;
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.commerce.OrderItem.Item) {
return mergeFrom((io.opencannabis.schema.commerce.OrderItem.Item)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.opencannabis.schema.commerce.OrderItem.Item other) {
if (other == io.opencannabis.schema.commerce.OrderItem.Item.getDefaultInstance()) return this;
if (other.hasKey()) {
mergeKey(other.getKey());
}
if (variantBuilder_ == null) {
if (!other.variant_.isEmpty()) {
if (variant_.isEmpty()) {
variant_ = other.variant_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureVariantIsMutable();
variant_.addAll(other.variant_);
}
onChanged();
}
} else {
if (!other.variant_.isEmpty()) {
if (variantBuilder_.isEmpty()) {
variantBuilder_.dispose();
variantBuilder_ = null;
variant_ = other.variant_;
bitField0_ = (bitField0_ & ~0x00000002);
variantBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getVariantFieldBuilder() : null;
} else {
variantBuilder_.addAllMessages(other.variant_);
}
}
}
if (other.getCount() != 0) {
setCount(other.getCount());
}
if (!other.getUri().isEmpty()) {
uri_ = other.uri_;
onChanged();
}
if (!other.getImageUri().isEmpty()) {
imageUri_ = other.imageUri_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.opencannabis.schema.commerce.OrderItem.Item parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.opencannabis.schema.commerce.OrderItem.Item) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private io.opencannabis.schema.base.BaseProductKey.ProductKey key_;
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.base.BaseProductKey.ProductKey, io.opencannabis.schema.base.BaseProductKey.ProductKey.Builder, io.opencannabis.schema.base.BaseProductKey.ProductKeyOrBuilder> keyBuilder_;
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public boolean hasKey() {
return keyBuilder_ != null || key_ != null;
}
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public io.opencannabis.schema.base.BaseProductKey.ProductKey getKey() {
if (keyBuilder_ == null) {
return key_ == null ? io.opencannabis.schema.base.BaseProductKey.ProductKey.getDefaultInstance() : key_;
} else {
return keyBuilder_.getMessage();
}
}
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public Builder setKey(io.opencannabis.schema.base.BaseProductKey.ProductKey value) {
if (keyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
key_ = value;
onChanged();
} else {
keyBuilder_.setMessage(value);
}
return this;
}
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public Builder setKey(
io.opencannabis.schema.base.BaseProductKey.ProductKey.Builder builderForValue) {
if (keyBuilder_ == null) {
key_ = builderForValue.build();
onChanged();
} else {
keyBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public Builder mergeKey(io.opencannabis.schema.base.BaseProductKey.ProductKey value) {
if (keyBuilder_ == null) {
if (key_ != null) {
key_ =
io.opencannabis.schema.base.BaseProductKey.ProductKey.newBuilder(key_).mergeFrom(value).buildPartial();
} else {
key_ = value;
}
onChanged();
} else {
keyBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public Builder clearKey() {
if (keyBuilder_ == null) {
key_ = null;
onChanged();
} else {
key_ = null;
keyBuilder_ = null;
}
return this;
}
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public io.opencannabis.schema.base.BaseProductKey.ProductKey.Builder getKeyBuilder() {
onChanged();
return getKeyFieldBuilder().getBuilder();
}
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
public io.opencannabis.schema.base.BaseProductKey.ProductKeyOrBuilder getKeyOrBuilder() {
if (keyBuilder_ != null) {
return keyBuilder_.getMessageOrBuilder();
} else {
return key_ == null ?
io.opencannabis.schema.base.BaseProductKey.ProductKey.getDefaultInstance() : key_;
}
}
/**
*
* Key for the item, which is the type and ID, combined.
*
*
* .opencannabis.base.ProductKey key = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.base.BaseProductKey.ProductKey, io.opencannabis.schema.base.BaseProductKey.ProductKey.Builder, io.opencannabis.schema.base.BaseProductKey.ProductKeyOrBuilder>
getKeyFieldBuilder() {
if (keyBuilder_ == null) {
keyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.base.BaseProductKey.ProductKey, io.opencannabis.schema.base.BaseProductKey.ProductKey.Builder, io.opencannabis.schema.base.BaseProductKey.ProductKeyOrBuilder>(
getKey(),
getParentForChildren(),
isClean());
key_ = null;
}
return keyBuilder_;
}
private java.util.List variant_ =
java.util.Collections.emptyList();
private void ensureVariantIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
variant_ = new java.util.ArrayList(variant_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.opencannabis.schema.commerce.OrderItem.VariantSpec, io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder, io.opencannabis.schema.commerce.OrderItem.VariantSpecOrBuilder> variantBuilder_;
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public java.util.List getVariantList() {
if (variantBuilder_ == null) {
return java.util.Collections.unmodifiableList(variant_);
} else {
return variantBuilder_.getMessageList();
}
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public int getVariantCount() {
if (variantBuilder_ == null) {
return variant_.size();
} else {
return variantBuilder_.getCount();
}
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public io.opencannabis.schema.commerce.OrderItem.VariantSpec getVariant(int index) {
if (variantBuilder_ == null) {
return variant_.get(index);
} else {
return variantBuilder_.getMessage(index);
}
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public Builder setVariant(
int index, io.opencannabis.schema.commerce.OrderItem.VariantSpec value) {
if (variantBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureVariantIsMutable();
variant_.set(index, value);
onChanged();
} else {
variantBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public Builder setVariant(
int index, io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder builderForValue) {
if (variantBuilder_ == null) {
ensureVariantIsMutable();
variant_.set(index, builderForValue.build());
onChanged();
} else {
variantBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public Builder addVariant(io.opencannabis.schema.commerce.OrderItem.VariantSpec value) {
if (variantBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureVariantIsMutable();
variant_.add(value);
onChanged();
} else {
variantBuilder_.addMessage(value);
}
return this;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public Builder addVariant(
int index, io.opencannabis.schema.commerce.OrderItem.VariantSpec value) {
if (variantBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureVariantIsMutable();
variant_.add(index, value);
onChanged();
} else {
variantBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public Builder addVariant(
io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder builderForValue) {
if (variantBuilder_ == null) {
ensureVariantIsMutable();
variant_.add(builderForValue.build());
onChanged();
} else {
variantBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public Builder addVariant(
int index, io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder builderForValue) {
if (variantBuilder_ == null) {
ensureVariantIsMutable();
variant_.add(index, builderForValue.build());
onChanged();
} else {
variantBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public Builder addAllVariant(
java.lang.Iterable extends io.opencannabis.schema.commerce.OrderItem.VariantSpec> values) {
if (variantBuilder_ == null) {
ensureVariantIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, variant_);
onChanged();
} else {
variantBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public Builder clearVariant() {
if (variantBuilder_ == null) {
variant_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
variantBuilder_.clear();
}
return this;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public Builder removeVariant(int index) {
if (variantBuilder_ == null) {
ensureVariantIsMutable();
variant_.remove(index);
onChanged();
} else {
variantBuilder_.remove(index);
}
return this;
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder getVariantBuilder(
int index) {
return getVariantFieldBuilder().getBuilder(index);
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public io.opencannabis.schema.commerce.OrderItem.VariantSpecOrBuilder getVariantOrBuilder(
int index) {
if (variantBuilder_ == null) {
return variant_.get(index); } else {
return variantBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public java.util.List extends io.opencannabis.schema.commerce.OrderItem.VariantSpecOrBuilder>
getVariantOrBuilderList() {
if (variantBuilder_ != null) {
return variantBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(variant_);
}
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder addVariantBuilder() {
return getVariantFieldBuilder().addBuilder(
io.opencannabis.schema.commerce.OrderItem.VariantSpec.getDefaultInstance());
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder addVariantBuilder(
int index) {
return getVariantFieldBuilder().addBuilder(
index, io.opencannabis.schema.commerce.OrderItem.VariantSpec.getDefaultInstance());
}
/**
*
* Variance specifications for this item.
*
*
* repeated .opencannabis.commerce.VariantSpec variant = 2;
*/
public java.util.List
getVariantBuilderList() {
return getVariantFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.opencannabis.schema.commerce.OrderItem.VariantSpec, io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder, io.opencannabis.schema.commerce.OrderItem.VariantSpecOrBuilder>
getVariantFieldBuilder() {
if (variantBuilder_ == null) {
variantBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
io.opencannabis.schema.commerce.OrderItem.VariantSpec, io.opencannabis.schema.commerce.OrderItem.VariantSpec.Builder, io.opencannabis.schema.commerce.OrderItem.VariantSpecOrBuilder>(
variant_,
((bitField0_ & 0x00000002) != 0),
getParentForChildren(),
isClean());
variant_ = null;
}
return variantBuilder_;
}
private int count_ ;
/**
*
* Count of this item requested.
*
*
* uint32 count = 3;
*/
public int getCount() {
return count_;
}
/**
*
* Count of this item requested.
*
*
* uint32 count = 3;
*/
public Builder setCount(int value) {
count_ = value;
onChanged();
return this;
}
/**
*
* Count of this item requested.
*
*
* uint32 count = 3;
*/
public Builder clearCount() {
count_ = 0;
onChanged();
return this;
}
private java.lang.Object uri_ = "";
/**
*
* Detail/link URL for this item.
*
*
* string uri = 4;
*/
public java.lang.String getUri() {
java.lang.Object ref = uri_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
uri_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Detail/link URL for this item.
*
*
* string uri = 4;
*/
public com.google.protobuf.ByteString
getUriBytes() {
java.lang.Object ref = uri_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
uri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Detail/link URL for this item.
*
*
* string uri = 4;
*/
public Builder setUri(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
uri_ = value;
onChanged();
return this;
}
/**
*
* Detail/link URL for this item.
*
*
* string uri = 4;
*/
public Builder clearUri() {
uri_ = getDefaultInstance().getUri();
onChanged();
return this;
}
/**
*
* Detail/link URL for this item.
*
*
* string uri = 4;
*/
public Builder setUriBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
uri_ = value;
onChanged();
return this;
}
private java.lang.Object imageUri_ = "";
/**
*
* Image URL for this item.
*
*
* string image_uri = 5;
*/
public java.lang.String getImageUri() {
java.lang.Object ref = imageUri_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
imageUri_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Image URL for this item.
*
*
* string image_uri = 5;
*/
public com.google.protobuf.ByteString
getImageUriBytes() {
java.lang.Object ref = imageUri_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
imageUri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Image URL for this item.
*
*
* string image_uri = 5;
*/
public Builder setImageUri(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
imageUri_ = value;
onChanged();
return this;
}
/**
*
* Image URL for this item.
*
*
* string image_uri = 5;
*/
public Builder clearImageUri() {
imageUri_ = getDefaultInstance().getImageUri();
onChanged();
return this;
}
/**
*
* Image URL for this item.
*
*
* string image_uri = 5;
*/
public Builder setImageUriBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
imageUri_ = 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:opencannabis.commerce.Item)
}
// @@protoc_insertion_point(class_scope:opencannabis.commerce.Item)
private static final io.opencannabis.schema.commerce.OrderItem.Item DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.opencannabis.schema.commerce.OrderItem.Item();
}
public static io.opencannabis.schema.commerce.OrderItem.Item getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser-
PARSER = new com.google.protobuf.AbstractParser
- () {
@java.lang.Override
public Item parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Item(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.commerce.OrderItem.Item getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_opencannabis_commerce_VariantSpec_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_opencannabis_commerce_VariantSpec_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_opencannabis_commerce_Item_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_opencannabis_commerce_Item_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\023commerce/Item.proto\022\025opencannabis.comm" +
"erce\032\025base/ProductKey.proto\032\'structs/pri" +
"cing/PricingDescriptor.proto\"\261\001\n\013Variant" +
"Spec\0226\n\007variant\030\001 \001(\0162%.opencannabis.com" +
"merce.ProductVariant\022A\n\006weight\030\002 \001(\0162/.o" +
"pencannabis.structs.pricing.PricingWeigh" +
"tTierH\000\022\016\n\004size\030\003 \001(\tH\000\022\017\n\005color\030\004 \001(\tH\000" +
"B\006\n\004spec\"\226\001\n\004Item\022*\n\003key\030\001 \001(\0132\035.opencan" +
"nabis.base.ProductKey\0223\n\007variant\030\002 \003(\0132\"" +
".opencannabis.commerce.VariantSpec\022\r\n\005co" +
"unt\030\003 \001(\r\022\013\n\003uri\030\004 \001(\t\022\021\n\timage_uri\030\005 \001(" +
"\t*1\n\016ProductVariant\022\n\n\006WEIGHT\020\000\022\t\n\005COLOR" +
"\020\001\022\010\n\004SIZE\020\002B6\n\037io.opencannabis.schema.c" +
"ommerceB\tOrderItemH\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.base.BaseProductKey.getDescriptor(),
io.opencannabis.schema.product.struct.ProductPricingSpec.getDescriptor(),
}, assigner);
internal_static_opencannabis_commerce_VariantSpec_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_opencannabis_commerce_VariantSpec_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_opencannabis_commerce_VariantSpec_descriptor,
new java.lang.String[] { "Variant", "Weight", "Size", "Color", "Spec", });
internal_static_opencannabis_commerce_Item_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_opencannabis_commerce_Item_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_opencannabis_commerce_Item_descriptor,
new java.lang.String[] { "Key", "Variant", "Count", "Uri", "ImageUri", });
io.opencannabis.schema.base.BaseProductKey.getDescriptor();
io.opencannabis.schema.product.struct.ProductPricingSpec.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy