
io.opencannabis.schema.currency.CommerceCurrency 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/Currency.proto
package io.opencannabis.schema.currency;
public final class CommerceCurrency {
private CommerceCurrency() {}
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 known or explicitly supported currency types.
*
*
* Protobuf enum {@code opencannabis.commerce.CurrencyType}
*/
public enum CurrencyType
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Fiat-based currency, such as the US Dollar.
*
*
* FIAT = 0;
*/
FIAT(0),
/**
*
* Real currency, such as gold or other raw materials.
*
*
* REAL = 1;
*/
REAL(1),
/**
*
* Crypto-currency, based on unique cryptographic signatures or proof-of-work.
*
*
* CRYPTO = 2;
*/
CRYPTO(2),
UNRECOGNIZED(-1),
;
/**
*
* Fiat-based currency, such as the US Dollar.
*
*
* FIAT = 0;
*/
public static final int FIAT_VALUE = 0;
/**
*
* Real currency, such as gold or other raw materials.
*
*
* REAL = 1;
*/
public static final int REAL_VALUE = 1;
/**
*
* Crypto-currency, based on unique cryptographic signatures or proof-of-work.
*
*
* CRYPTO = 2;
*/
public static final int CRYPTO_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 CurrencyType valueOf(int value) {
return forNumber(value);
}
public static CurrencyType forNumber(int value) {
switch (value) {
case 0: return FIAT;
case 1: return REAL;
case 2: return CRYPTO;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
CurrencyType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public CurrencyType findValueByNumber(int number) {
return CurrencyType.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.currency.CommerceCurrency.getDescriptor().getEnumTypes().get(0);
}
private static final CurrencyType[] VALUES = values();
public static CurrencyType 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 CurrencyType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:opencannabis.commerce.CurrencyType)
}
/**
*
* Specifies known or explicitly supported fiat currencies.
*
*
* Protobuf enum {@code opencannabis.commerce.FiatCurrency}
*/
public enum FiatCurrency
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Specifies 'US Dollar' as a currency.
*
*
* USD = 0;
*/
USD(0),
/**
*
* Specifies 'Canadian Dollar' as a currency.
*
*
* CAD = 1;
*/
CAD(1),
/**
*
* Specifies 'Euro' as a currency.
*
*
* EUR = 2;
*/
EUR(2),
UNRECOGNIZED(-1),
;
/**
*
* Specifies 'US Dollar' as a currency.
*
*
* USD = 0;
*/
public static final int USD_VALUE = 0;
/**
*
* Specifies 'Canadian Dollar' as a currency.
*
*
* CAD = 1;
*/
public static final int CAD_VALUE = 1;
/**
*
* Specifies 'Euro' as a currency.
*
*
* EUR = 2;
*/
public static final int EUR_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 FiatCurrency valueOf(int value) {
return forNumber(value);
}
public static FiatCurrency forNumber(int value) {
switch (value) {
case 0: return USD;
case 1: return CAD;
case 2: return EUR;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
FiatCurrency> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public FiatCurrency findValueByNumber(int number) {
return FiatCurrency.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.currency.CommerceCurrency.getDescriptor().getEnumTypes().get(1);
}
private static final FiatCurrency[] VALUES = values();
public static FiatCurrency 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 FiatCurrency(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:opencannabis.commerce.FiatCurrency)
}
public interface CurrencyValueOrBuilder extends
// @@protoc_insertion_point(interface_extends:opencannabis.commerce.CurrencyValue)
com.google.protobuf.MessageOrBuilder {
/**
*
* Numeric amount value to specify.
*
*
* float value = 1;
*/
float getValue();
/**
*
* Categorical or general type for the specified currency.
*
*
* .opencannabis.commerce.CurrencyType type = 2;
*/
int getTypeValue();
/**
*
* Categorical or general type for the specified currency.
*
*
* .opencannabis.commerce.CurrencyType type = 2;
*/
io.opencannabis.schema.currency.CommerceCurrency.CurrencyType getType();
/**
*
* Fiat currency selection for a given currency value.
*
*
* .opencannabis.commerce.FiatCurrency fiat = 10;
*/
int getFiatValue();
/**
*
* Fiat currency selection for a given currency value.
*
*
* .opencannabis.commerce.FiatCurrency fiat = 10;
*/
io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency getFiat();
/**
*
* Custom currency, by name or symbol, for a given currency value.
*
*
* string custom = 100;
*/
java.lang.String getCustom();
/**
*
* Custom currency, by name or symbol, for a given currency value.
*
*
* string custom = 100;
*/
com.google.protobuf.ByteString
getCustomBytes();
public io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue.SpecCase getSpecCase();
}
/**
*
* Specifies a value, with a particular currency specification as the unit.
*
*
* Protobuf type {@code opencannabis.commerce.CurrencyValue}
*/
public static final class CurrencyValue extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:opencannabis.commerce.CurrencyValue)
CurrencyValueOrBuilder {
private static final long serialVersionUID = 0L;
// Use CurrencyValue.newBuilder() to construct.
private CurrencyValue(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private CurrencyValue() {
type_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private CurrencyValue(
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 13: {
value_ = input.readFloat();
break;
}
case 16: {
int rawValue = input.readEnum();
type_ = rawValue;
break;
}
case 80: {
int rawValue = input.readEnum();
specCase_ = 10;
spec_ = rawValue;
break;
}
case 802: {
java.lang.String s = input.readStringRequireUtf8();
specCase_ = 100;
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.currency.CommerceCurrency.internal_static_opencannabis_commerce_CurrencyValue_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.currency.CommerceCurrency.internal_static_opencannabis_commerce_CurrencyValue_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue.class, io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue.Builder.class);
}
private int specCase_ = 0;
private java.lang.Object spec_;
public enum SpecCase
implements com.google.protobuf.Internal.EnumLite {
FIAT(10),
CUSTOM(100),
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 10: return FIAT;
case 100: return CUSTOM;
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 VALUE_FIELD_NUMBER = 1;
private float value_;
/**
*
* Numeric amount value to specify.
*
*
* float value = 1;
*/
public float getValue() {
return value_;
}
public static final int TYPE_FIELD_NUMBER = 2;
private int type_;
/**
*
* Categorical or general type for the specified currency.
*
*
* .opencannabis.commerce.CurrencyType type = 2;
*/
public int getTypeValue() {
return type_;
}
/**
*
* Categorical or general type for the specified currency.
*
*
* .opencannabis.commerce.CurrencyType type = 2;
*/
public io.opencannabis.schema.currency.CommerceCurrency.CurrencyType getType() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.currency.CommerceCurrency.CurrencyType result = io.opencannabis.schema.currency.CommerceCurrency.CurrencyType.valueOf(type_);
return result == null ? io.opencannabis.schema.currency.CommerceCurrency.CurrencyType.UNRECOGNIZED : result;
}
public static final int FIAT_FIELD_NUMBER = 10;
/**
*
* Fiat currency selection for a given currency value.
*
*
* .opencannabis.commerce.FiatCurrency fiat = 10;
*/
public int getFiatValue() {
if (specCase_ == 10) {
return (java.lang.Integer) spec_;
}
return 0;
}
/**
*
* Fiat currency selection for a given currency value.
*
*
* .opencannabis.commerce.FiatCurrency fiat = 10;
*/
public io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency getFiat() {
if (specCase_ == 10) {
@SuppressWarnings("deprecation")
io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency result = io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency.valueOf(
(java.lang.Integer) spec_);
return result == null ? io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency.UNRECOGNIZED : result;
}
return io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency.USD;
}
public static final int CUSTOM_FIELD_NUMBER = 100;
/**
*
* Custom currency, by name or symbol, for a given currency value.
*
*
* string custom = 100;
*/
public java.lang.String getCustom() {
java.lang.Object ref = "";
if (specCase_ == 100) {
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_ == 100) {
spec_ = s;
}
return s;
}
}
/**
*
* Custom currency, by name or symbol, for a given currency value.
*
*
* string custom = 100;
*/
public com.google.protobuf.ByteString
getCustomBytes() {
java.lang.Object ref = "";
if (specCase_ == 100) {
ref = spec_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (specCase_ == 100) {
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 (value_ != 0F) {
output.writeFloat(1, value_);
}
if (type_ != io.opencannabis.schema.currency.CommerceCurrency.CurrencyType.FIAT.getNumber()) {
output.writeEnum(2, type_);
}
if (specCase_ == 10) {
output.writeEnum(10, ((java.lang.Integer) spec_));
}
if (specCase_ == 100) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 100, spec_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (value_ != 0F) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(1, value_);
}
if (type_ != io.opencannabis.schema.currency.CommerceCurrency.CurrencyType.FIAT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, type_);
}
if (specCase_ == 10) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(10, ((java.lang.Integer) spec_));
}
if (specCase_ == 100) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(100, 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.currency.CommerceCurrency.CurrencyValue)) {
return super.equals(obj);
}
io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue other = (io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue) obj;
if (java.lang.Float.floatToIntBits(getValue())
!= java.lang.Float.floatToIntBits(
other.getValue())) return false;
if (type_ != other.type_) return false;
if (!getSpecCase().equals(other.getSpecCase())) return false;
switch (specCase_) {
case 10:
if (getFiatValue()
!= other.getFiatValue()) return false;
break;
case 100:
if (!getCustom()
.equals(other.getCustom())) 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) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(
getValue());
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
switch (specCase_) {
case 10:
hash = (37 * hash) + FIAT_FIELD_NUMBER;
hash = (53 * hash) + getFiatValue();
break;
case 100:
hash = (37 * hash) + CUSTOM_FIELD_NUMBER;
hash = (53 * hash) + getCustom().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue 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.currency.CommerceCurrency.CurrencyValue parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue 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.currency.CommerceCurrency.CurrencyValue parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue 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.currency.CommerceCurrency.CurrencyValue parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue 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.currency.CommerceCurrency.CurrencyValue parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue 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.currency.CommerceCurrency.CurrencyValue prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Specifies a value, with a particular currency specification as the unit.
*
*
* Protobuf type {@code opencannabis.commerce.CurrencyValue}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:opencannabis.commerce.CurrencyValue)
io.opencannabis.schema.currency.CommerceCurrency.CurrencyValueOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencannabis.schema.currency.CommerceCurrency.internal_static_opencannabis_commerce_CurrencyValue_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.currency.CommerceCurrency.internal_static_opencannabis_commerce_CurrencyValue_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue.class, io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue.Builder.class);
}
// Construct using io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue.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();
value_ = 0F;
type_ = 0;
specCase_ = 0;
spec_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.opencannabis.schema.currency.CommerceCurrency.internal_static_opencannabis_commerce_CurrencyValue_descriptor;
}
@java.lang.Override
public io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue getDefaultInstanceForType() {
return io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue.getDefaultInstance();
}
@java.lang.Override
public io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue build() {
io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue buildPartial() {
io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue result = new io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue(this);
result.value_ = value_;
result.type_ = type_;
if (specCase_ == 10) {
result.spec_ = spec_;
}
if (specCase_ == 100) {
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.currency.CommerceCurrency.CurrencyValue) {
return mergeFrom((io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue other) {
if (other == io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue.getDefaultInstance()) return this;
if (other.getValue() != 0F) {
setValue(other.getValue());
}
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
switch (other.getSpecCase()) {
case FIAT: {
setFiatValue(other.getFiatValue());
break;
}
case CUSTOM: {
specCase_ = 100;
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.currency.CommerceCurrency.CurrencyValue parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue) 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 float value_ ;
/**
*
* Numeric amount value to specify.
*
*
* float value = 1;
*/
public float getValue() {
return value_;
}
/**
*
* Numeric amount value to specify.
*
*
* float value = 1;
*/
public Builder setValue(float value) {
value_ = value;
onChanged();
return this;
}
/**
*
* Numeric amount value to specify.
*
*
* float value = 1;
*/
public Builder clearValue() {
value_ = 0F;
onChanged();
return this;
}
private int type_ = 0;
/**
*
* Categorical or general type for the specified currency.
*
*
* .opencannabis.commerce.CurrencyType type = 2;
*/
public int getTypeValue() {
return type_;
}
/**
*
* Categorical or general type for the specified currency.
*
*
* .opencannabis.commerce.CurrencyType type = 2;
*/
public Builder setTypeValue(int value) {
type_ = value;
onChanged();
return this;
}
/**
*
* Categorical or general type for the specified currency.
*
*
* .opencannabis.commerce.CurrencyType type = 2;
*/
public io.opencannabis.schema.currency.CommerceCurrency.CurrencyType getType() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.currency.CommerceCurrency.CurrencyType result = io.opencannabis.schema.currency.CommerceCurrency.CurrencyType.valueOf(type_);
return result == null ? io.opencannabis.schema.currency.CommerceCurrency.CurrencyType.UNRECOGNIZED : result;
}
/**
*
* Categorical or general type for the specified currency.
*
*
* .opencannabis.commerce.CurrencyType type = 2;
*/
public Builder setType(io.opencannabis.schema.currency.CommerceCurrency.CurrencyType value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Categorical or general type for the specified currency.
*
*
* .opencannabis.commerce.CurrencyType type = 2;
*/
public Builder clearType() {
type_ = 0;
onChanged();
return this;
}
/**
*
* Fiat currency selection for a given currency value.
*
*
* .opencannabis.commerce.FiatCurrency fiat = 10;
*/
public int getFiatValue() {
if (specCase_ == 10) {
return ((java.lang.Integer) spec_).intValue();
}
return 0;
}
/**
*
* Fiat currency selection for a given currency value.
*
*
* .opencannabis.commerce.FiatCurrency fiat = 10;
*/
public Builder setFiatValue(int value) {
specCase_ = 10;
spec_ = value;
onChanged();
return this;
}
/**
*
* Fiat currency selection for a given currency value.
*
*
* .opencannabis.commerce.FiatCurrency fiat = 10;
*/
public io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency getFiat() {
if (specCase_ == 10) {
@SuppressWarnings("deprecation")
io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency result = io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency.valueOf(
(java.lang.Integer) spec_);
return result == null ? io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency.UNRECOGNIZED : result;
}
return io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency.USD;
}
/**
*
* Fiat currency selection for a given currency value.
*
*
* .opencannabis.commerce.FiatCurrency fiat = 10;
*/
public Builder setFiat(io.opencannabis.schema.currency.CommerceCurrency.FiatCurrency value) {
if (value == null) {
throw new NullPointerException();
}
specCase_ = 10;
spec_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Fiat currency selection for a given currency value.
*
*
* .opencannabis.commerce.FiatCurrency fiat = 10;
*/
public Builder clearFiat() {
if (specCase_ == 10) {
specCase_ = 0;
spec_ = null;
onChanged();
}
return this;
}
/**
*
* Custom currency, by name or symbol, for a given currency value.
*
*
* string custom = 100;
*/
public java.lang.String getCustom() {
java.lang.Object ref = "";
if (specCase_ == 100) {
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_ == 100) {
spec_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Custom currency, by name or symbol, for a given currency value.
*
*
* string custom = 100;
*/
public com.google.protobuf.ByteString
getCustomBytes() {
java.lang.Object ref = "";
if (specCase_ == 100) {
ref = spec_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (specCase_ == 100) {
spec_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Custom currency, by name or symbol, for a given currency value.
*
*
* string custom = 100;
*/
public Builder setCustom(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
specCase_ = 100;
spec_ = value;
onChanged();
return this;
}
/**
*
* Custom currency, by name or symbol, for a given currency value.
*
*
* string custom = 100;
*/
public Builder clearCustom() {
if (specCase_ == 100) {
specCase_ = 0;
spec_ = null;
onChanged();
}
return this;
}
/**
*
* Custom currency, by name or symbol, for a given currency value.
*
*
* string custom = 100;
*/
public Builder setCustomBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
specCase_ = 100;
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.CurrencyValue)
}
// @@protoc_insertion_point(class_scope:opencannabis.commerce.CurrencyValue)
private static final io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue();
}
public static io.opencannabis.schema.currency.CommerceCurrency.CurrencyValue getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public CurrencyValue parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new CurrencyValue(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.currency.CommerceCurrency.CurrencyValue getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_opencannabis_commerce_CurrencyValue_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_opencannabis_commerce_CurrencyValue_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\027commerce/Currency.proto\022\025opencannabis." +
"commerce\"\240\001\n\rCurrencyValue\022\r\n\005value\030\001 \001(" +
"\002\0221\n\004type\030\002 \001(\0162#.opencannabis.commerce." +
"CurrencyType\0223\n\004fiat\030\n \001(\0162#.opencannabi" +
"s.commerce.FiatCurrencyH\000\022\020\n\006custom\030d \001(" +
"\tH\000B\006\n\004spec*.\n\014CurrencyType\022\010\n\004FIAT\020\000\022\010\n" +
"\004REAL\020\001\022\n\n\006CRYPTO\020\002*)\n\014FiatCurrency\022\007\n\003U" +
"SD\020\000\022\007\n\003CAD\020\001\022\007\n\003EUR\020\002B=\n\037io.opencannabi" +
"s.schema.currencyB\020CommerceCurrencyH\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[] {
}, assigner);
internal_static_opencannabis_commerce_CurrencyValue_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_opencannabis_commerce_CurrencyValue_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_opencannabis_commerce_CurrencyValue_descriptor,
new java.lang.String[] { "Value", "Type", "Fiat", "Custom", "Spec", });
}
// @@protoc_insertion_point(outer_class_scope)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy