
io.opencannabis.schema.product.struct.testing.TestValue Maven / Gradle / Ivy
/*
* Copyright 2018, Momentum Ideas, Co. All rights reserved.
*
* Source and object computer code contained herein is the private intellectual
* property of Momentum Ideas Co., a Delaware Corporation. Use of this
* code in source form requires permission in writing before use or the
* assembly, distribution, or publishing of derivative works, for commercial
* purposes or any other purpose, from a duly authorized officer of Momentum
* Ideas Co.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: structs/labtesting/TestValue.proto
package io.opencannabis.schema.product.struct.testing;
/**
* Protobuf type {@code opencannabis.structs.labtesting.TestValue}
*/
public final class TestValue extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:opencannabis.structs.labtesting.TestValue)
TestValueOrBuilder {
private static final long serialVersionUID = 0L;
// Use TestValue.newBuilder() to construct.
private TestValue(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private TestValue() {
type_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TestValue(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
type_ = rawValue;
break;
}
case 18: {
io.opencannabis.schema.product.struct.testing.TestValue.TestError.Builder subBuilder = null;
if (error_ != null) {
subBuilder = error_.toBuilder();
}
error_ = input.readMessage(io.opencannabis.schema.product.struct.testing.TestValue.TestError.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(error_);
error_ = subBuilder.buildPartial();
}
break;
}
case 81: {
valueCase_ = 10;
value_ = input.readDouble();
break;
}
case 160: {
valueCase_ = 20;
value_ = input.readBool();
break;
}
default: {
if (!parseUnknownFieldProto3(
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.product.struct.testing.BaseTestingSpec.internal_static_opencannabis_structs_labtesting_TestValue_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.product.struct.testing.BaseTestingSpec.internal_static_opencannabis_structs_labtesting_TestValue_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.product.struct.testing.TestValue.class, io.opencannabis.schema.product.struct.testing.TestValue.Builder.class);
}
public interface TestErrorOrBuilder extends
// @@protoc_insertion_point(interface_extends:opencannabis.structs.labtesting.TestValue.TestError)
com.google.protobuf.MessageOrBuilder {
/**
* .opencannabis.structs.labtesting.TestErrorType type = 1;
*/
int getTypeValue();
/**
* .opencannabis.structs.labtesting.TestErrorType type = 1;
*/
io.opencannabis.schema.product.struct.testing.TestErrorType getType();
/**
* double value = 2;
*/
double getValue();
}
/**
*
* Represents the degree of uncertainty that arises during testing and consists of the type of error being reported
* along with the error value. See more information at:
* https://www.nde-ed.org/GeneralResources/ErrorAnalysis/UncertaintyTerms.htm
*
*
* Protobuf type {@code opencannabis.structs.labtesting.TestValue.TestError}
*/
public static final class TestError extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:opencannabis.structs.labtesting.TestValue.TestError)
TestErrorOrBuilder {
private static final long serialVersionUID = 0L;
// Use TestError.newBuilder() to construct.
private TestError(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private TestError() {
type_ = 0;
value_ = 0D;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TestError(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
type_ = rawValue;
break;
}
case 17: {
value_ = input.readDouble();
break;
}
default: {
if (!parseUnknownFieldProto3(
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.product.struct.testing.BaseTestingSpec.internal_static_opencannabis_structs_labtesting_TestValue_TestError_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.product.struct.testing.BaseTestingSpec.internal_static_opencannabis_structs_labtesting_TestValue_TestError_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.product.struct.testing.TestValue.TestError.class, io.opencannabis.schema.product.struct.testing.TestValue.TestError.Builder.class);
}
public static final int TYPE_FIELD_NUMBER = 1;
private int type_;
/**
* .opencannabis.structs.labtesting.TestErrorType type = 1;
*/
public int getTypeValue() {
return type_;
}
/**
* .opencannabis.structs.labtesting.TestErrorType type = 1;
*/
public io.opencannabis.schema.product.struct.testing.TestErrorType getType() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.testing.TestErrorType result = io.opencannabis.schema.product.struct.testing.TestErrorType.valueOf(type_);
return result == null ? io.opencannabis.schema.product.struct.testing.TestErrorType.UNRECOGNIZED : result;
}
public static final int VALUE_FIELD_NUMBER = 2;
private double value_;
/**
* double value = 2;
*/
public double getValue() {
return value_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (type_ != io.opencannabis.schema.product.struct.testing.TestErrorType.PERCENT.getNumber()) {
output.writeEnum(1, type_);
}
if (value_ != 0D) {
output.writeDouble(2, value_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (type_ != io.opencannabis.schema.product.struct.testing.TestErrorType.PERCENT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, type_);
}
if (value_ != 0D) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(2, value_);
}
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.product.struct.testing.TestValue.TestError)) {
return super.equals(obj);
}
io.opencannabis.schema.product.struct.testing.TestValue.TestError other = (io.opencannabis.schema.product.struct.testing.TestValue.TestError) obj;
boolean result = true;
result = result && type_ == other.type_;
result = result && (
java.lang.Double.doubleToLongBits(getValue())
== java.lang.Double.doubleToLongBits(
other.getValue()));
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
hash = (37 * hash) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getValue()));
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.opencannabis.schema.product.struct.testing.TestValue.TestError parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.product.struct.testing.TestValue.TestError 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.product.struct.testing.TestValue.TestError parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.product.struct.testing.TestValue.TestError 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.product.struct.testing.TestValue.TestError parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.product.struct.testing.TestValue.TestError parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencannabis.schema.product.struct.testing.TestValue.TestError parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.product.struct.testing.TestValue.TestError 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.product.struct.testing.TestValue.TestError parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.opencannabis.schema.product.struct.testing.TestValue.TestError 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.product.struct.testing.TestValue.TestError parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.product.struct.testing.TestValue.TestError 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.product.struct.testing.TestValue.TestError 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;
}
/**
*
* Represents the degree of uncertainty that arises during testing and consists of the type of error being reported
* along with the error value. See more information at:
* https://www.nde-ed.org/GeneralResources/ErrorAnalysis/UncertaintyTerms.htm
*
*
* Protobuf type {@code opencannabis.structs.labtesting.TestValue.TestError}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:opencannabis.structs.labtesting.TestValue.TestError)
io.opencannabis.schema.product.struct.testing.TestValue.TestErrorOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencannabis.schema.product.struct.testing.BaseTestingSpec.internal_static_opencannabis_structs_labtesting_TestValue_TestError_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.product.struct.testing.BaseTestingSpec.internal_static_opencannabis_structs_labtesting_TestValue_TestError_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.product.struct.testing.TestValue.TestError.class, io.opencannabis.schema.product.struct.testing.TestValue.TestError.Builder.class);
}
// Construct using io.opencannabis.schema.product.struct.testing.TestValue.TestError.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
type_ = 0;
value_ = 0D;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.opencannabis.schema.product.struct.testing.BaseTestingSpec.internal_static_opencannabis_structs_labtesting_TestValue_TestError_descriptor;
}
@java.lang.Override
public io.opencannabis.schema.product.struct.testing.TestValue.TestError getDefaultInstanceForType() {
return io.opencannabis.schema.product.struct.testing.TestValue.TestError.getDefaultInstance();
}
@java.lang.Override
public io.opencannabis.schema.product.struct.testing.TestValue.TestError build() {
io.opencannabis.schema.product.struct.testing.TestValue.TestError result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.opencannabis.schema.product.struct.testing.TestValue.TestError buildPartial() {
io.opencannabis.schema.product.struct.testing.TestValue.TestError result = new io.opencannabis.schema.product.struct.testing.TestValue.TestError(this);
result.type_ = type_;
result.value_ = value_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return (Builder) super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.opencannabis.schema.product.struct.testing.TestValue.TestError) {
return mergeFrom((io.opencannabis.schema.product.struct.testing.TestValue.TestError)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.opencannabis.schema.product.struct.testing.TestValue.TestError other) {
if (other == io.opencannabis.schema.product.struct.testing.TestValue.TestError.getDefaultInstance()) return this;
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
if (other.getValue() != 0D) {
setValue(other.getValue());
}
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.product.struct.testing.TestValue.TestError parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.opencannabis.schema.product.struct.testing.TestValue.TestError) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int type_ = 0;
/**
* .opencannabis.structs.labtesting.TestErrorType type = 1;
*/
public int getTypeValue() {
return type_;
}
/**
* .opencannabis.structs.labtesting.TestErrorType type = 1;
*/
public Builder setTypeValue(int value) {
type_ = value;
onChanged();
return this;
}
/**
* .opencannabis.structs.labtesting.TestErrorType type = 1;
*/
public io.opencannabis.schema.product.struct.testing.TestErrorType getType() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.testing.TestErrorType result = io.opencannabis.schema.product.struct.testing.TestErrorType.valueOf(type_);
return result == null ? io.opencannabis.schema.product.struct.testing.TestErrorType.UNRECOGNIZED : result;
}
/**
* .opencannabis.structs.labtesting.TestErrorType type = 1;
*/
public Builder setType(io.opencannabis.schema.product.struct.testing.TestErrorType value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value.getNumber();
onChanged();
return this;
}
/**
* .opencannabis.structs.labtesting.TestErrorType type = 1;
*/
public Builder clearType() {
type_ = 0;
onChanged();
return this;
}
private double value_ ;
/**
* double value = 2;
*/
public double getValue() {
return value_;
}
/**
* double value = 2;
*/
public Builder setValue(double value) {
value_ = value;
onChanged();
return this;
}
/**
* double value = 2;
*/
public Builder clearValue() {
value_ = 0D;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:opencannabis.structs.labtesting.TestValue.TestError)
}
// @@protoc_insertion_point(class_scope:opencannabis.structs.labtesting.TestValue.TestError)
private static final io.opencannabis.schema.product.struct.testing.TestValue.TestError DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.opencannabis.schema.product.struct.testing.TestValue.TestError();
}
public static io.opencannabis.schema.product.struct.testing.TestValue.TestError getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public TestError parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TestError(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.product.struct.testing.TestValue.TestError getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int valueCase_ = 0;
private java.lang.Object value_;
public enum ValueCase
implements com.google.protobuf.Internal.EnumLite {
MEASUREMENT(10),
PRESENT(20),
VALUE_NOT_SET(0);
private final int value;
private ValueCase(int value) {
this.value = value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static ValueCase valueOf(int value) {
return forNumber(value);
}
public static ValueCase forNumber(int value) {
switch (value) {
case 10: return MEASUREMENT;
case 20: return PRESENT;
case 0: return VALUE_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public ValueCase
getValueCase() {
return ValueCase.forNumber(
valueCase_);
}
public static final int TYPE_FIELD_NUMBER = 1;
private int type_;
/**
* .opencannabis.structs.labtesting.TestValueType type = 1;
*/
public int getTypeValue() {
return type_;
}
/**
* .opencannabis.structs.labtesting.TestValueType type = 1;
*/
public io.opencannabis.schema.product.struct.testing.TestValueType getType() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.testing.TestValueType result = io.opencannabis.schema.product.struct.testing.TestValueType.valueOf(type_);
return result == null ? io.opencannabis.schema.product.struct.testing.TestValueType.UNRECOGNIZED : result;
}
public static final int ERROR_FIELD_NUMBER = 2;
private io.opencannabis.schema.product.struct.testing.TestValue.TestError error_;
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public boolean hasError() {
return error_ != null;
}
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public io.opencannabis.schema.product.struct.testing.TestValue.TestError getError() {
return error_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.TestError.getDefaultInstance() : error_;
}
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public io.opencannabis.schema.product.struct.testing.TestValue.TestErrorOrBuilder getErrorOrBuilder() {
return getError();
}
public static final int MEASUREMENT_FIELD_NUMBER = 10;
/**
* double measurement = 10;
*/
public double getMeasurement() {
if (valueCase_ == 10) {
return (java.lang.Double) value_;
}
return 0D;
}
public static final int PRESENT_FIELD_NUMBER = 20;
/**
* bool present = 20;
*/
public boolean getPresent() {
if (valueCase_ == 20) {
return (java.lang.Boolean) value_;
}
return false;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (type_ != io.opencannabis.schema.product.struct.testing.TestValueType.MILLIGRAMS.getNumber()) {
output.writeEnum(1, type_);
}
if (error_ != null) {
output.writeMessage(2, getError());
}
if (valueCase_ == 10) {
output.writeDouble(
10, (double)((java.lang.Double) value_));
}
if (valueCase_ == 20) {
output.writeBool(
20, (boolean)((java.lang.Boolean) value_));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (type_ != io.opencannabis.schema.product.struct.testing.TestValueType.MILLIGRAMS.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, type_);
}
if (error_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getError());
}
if (valueCase_ == 10) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(
10, (double)((java.lang.Double) value_));
}
if (valueCase_ == 20) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
20, (boolean)((java.lang.Boolean) value_));
}
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.product.struct.testing.TestValue)) {
return super.equals(obj);
}
io.opencannabis.schema.product.struct.testing.TestValue other = (io.opencannabis.schema.product.struct.testing.TestValue) obj;
boolean result = true;
result = result && type_ == other.type_;
result = result && (hasError() == other.hasError());
if (hasError()) {
result = result && getError()
.equals(other.getError());
}
result = result && getValueCase().equals(
other.getValueCase());
if (!result) return false;
switch (valueCase_) {
case 10:
result = result && (
java.lang.Double.doubleToLongBits(getMeasurement())
== java.lang.Double.doubleToLongBits(
other.getMeasurement()));
break;
case 20:
result = result && (getPresent()
== other.getPresent());
break;
case 0:
default:
}
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
if (hasError()) {
hash = (37 * hash) + ERROR_FIELD_NUMBER;
hash = (53 * hash) + getError().hashCode();
}
switch (valueCase_) {
case 10:
hash = (37 * hash) + MEASUREMENT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getMeasurement()));
break;
case 20:
hash = (37 * hash) + PRESENT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getPresent());
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.opencannabis.schema.product.struct.testing.TestValue parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.product.struct.testing.TestValue 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.product.struct.testing.TestValue parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.product.struct.testing.TestValue 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.product.struct.testing.TestValue parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencannabis.schema.product.struct.testing.TestValue parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencannabis.schema.product.struct.testing.TestValue parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.product.struct.testing.TestValue 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.product.struct.testing.TestValue parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.opencannabis.schema.product.struct.testing.TestValue 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.product.struct.testing.TestValue parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencannabis.schema.product.struct.testing.TestValue 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.product.struct.testing.TestValue 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;
}
/**
* Protobuf type {@code opencannabis.structs.labtesting.TestValue}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:opencannabis.structs.labtesting.TestValue)
io.opencannabis.schema.product.struct.testing.TestValueOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencannabis.schema.product.struct.testing.BaseTestingSpec.internal_static_opencannabis_structs_labtesting_TestValue_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencannabis.schema.product.struct.testing.BaseTestingSpec.internal_static_opencannabis_structs_labtesting_TestValue_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencannabis.schema.product.struct.testing.TestValue.class, io.opencannabis.schema.product.struct.testing.TestValue.Builder.class);
}
// Construct using io.opencannabis.schema.product.struct.testing.TestValue.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
type_ = 0;
if (errorBuilder_ == null) {
error_ = null;
} else {
error_ = null;
errorBuilder_ = null;
}
valueCase_ = 0;
value_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.opencannabis.schema.product.struct.testing.BaseTestingSpec.internal_static_opencannabis_structs_labtesting_TestValue_descriptor;
}
@java.lang.Override
public io.opencannabis.schema.product.struct.testing.TestValue getDefaultInstanceForType() {
return io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance();
}
@java.lang.Override
public io.opencannabis.schema.product.struct.testing.TestValue build() {
io.opencannabis.schema.product.struct.testing.TestValue result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.opencannabis.schema.product.struct.testing.TestValue buildPartial() {
io.opencannabis.schema.product.struct.testing.TestValue result = new io.opencannabis.schema.product.struct.testing.TestValue(this);
result.type_ = type_;
if (errorBuilder_ == null) {
result.error_ = error_;
} else {
result.error_ = errorBuilder_.build();
}
if (valueCase_ == 10) {
result.value_ = value_;
}
if (valueCase_ == 20) {
result.value_ = value_;
}
result.valueCase_ = valueCase_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return (Builder) super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.opencannabis.schema.product.struct.testing.TestValue) {
return mergeFrom((io.opencannabis.schema.product.struct.testing.TestValue)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.opencannabis.schema.product.struct.testing.TestValue other) {
if (other == io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance()) return this;
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
if (other.hasError()) {
mergeError(other.getError());
}
switch (other.getValueCase()) {
case MEASUREMENT: {
setMeasurement(other.getMeasurement());
break;
}
case PRESENT: {
setPresent(other.getPresent());
break;
}
case VALUE_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.product.struct.testing.TestValue parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.opencannabis.schema.product.struct.testing.TestValue) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int valueCase_ = 0;
private java.lang.Object value_;
public ValueCase
getValueCase() {
return ValueCase.forNumber(
valueCase_);
}
public Builder clearValue() {
valueCase_ = 0;
value_ = null;
onChanged();
return this;
}
private int type_ = 0;
/**
* .opencannabis.structs.labtesting.TestValueType type = 1;
*/
public int getTypeValue() {
return type_;
}
/**
* .opencannabis.structs.labtesting.TestValueType type = 1;
*/
public Builder setTypeValue(int value) {
type_ = value;
onChanged();
return this;
}
/**
* .opencannabis.structs.labtesting.TestValueType type = 1;
*/
public io.opencannabis.schema.product.struct.testing.TestValueType getType() {
@SuppressWarnings("deprecation")
io.opencannabis.schema.product.struct.testing.TestValueType result = io.opencannabis.schema.product.struct.testing.TestValueType.valueOf(type_);
return result == null ? io.opencannabis.schema.product.struct.testing.TestValueType.UNRECOGNIZED : result;
}
/**
* .opencannabis.structs.labtesting.TestValueType type = 1;
*/
public Builder setType(io.opencannabis.schema.product.struct.testing.TestValueType value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value.getNumber();
onChanged();
return this;
}
/**
* .opencannabis.structs.labtesting.TestValueType type = 1;
*/
public Builder clearType() {
type_ = 0;
onChanged();
return this;
}
private io.opencannabis.schema.product.struct.testing.TestValue.TestError error_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.product.struct.testing.TestValue.TestError, io.opencannabis.schema.product.struct.testing.TestValue.TestError.Builder, io.opencannabis.schema.product.struct.testing.TestValue.TestErrorOrBuilder> errorBuilder_;
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public boolean hasError() {
return errorBuilder_ != null || error_ != null;
}
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public io.opencannabis.schema.product.struct.testing.TestValue.TestError getError() {
if (errorBuilder_ == null) {
return error_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.TestError.getDefaultInstance() : error_;
} else {
return errorBuilder_.getMessage();
}
}
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public Builder setError(io.opencannabis.schema.product.struct.testing.TestValue.TestError value) {
if (errorBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
error_ = value;
onChanged();
} else {
errorBuilder_.setMessage(value);
}
return this;
}
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public Builder setError(
io.opencannabis.schema.product.struct.testing.TestValue.TestError.Builder builderForValue) {
if (errorBuilder_ == null) {
error_ = builderForValue.build();
onChanged();
} else {
errorBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public Builder mergeError(io.opencannabis.schema.product.struct.testing.TestValue.TestError value) {
if (errorBuilder_ == null) {
if (error_ != null) {
error_ =
io.opencannabis.schema.product.struct.testing.TestValue.TestError.newBuilder(error_).mergeFrom(value).buildPartial();
} else {
error_ = value;
}
onChanged();
} else {
errorBuilder_.mergeFrom(value);
}
return this;
}
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public Builder clearError() {
if (errorBuilder_ == null) {
error_ = null;
onChanged();
} else {
error_ = null;
errorBuilder_ = null;
}
return this;
}
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public io.opencannabis.schema.product.struct.testing.TestValue.TestError.Builder getErrorBuilder() {
onChanged();
return getErrorFieldBuilder().getBuilder();
}
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
public io.opencannabis.schema.product.struct.testing.TestValue.TestErrorOrBuilder getErrorOrBuilder() {
if (errorBuilder_ != null) {
return errorBuilder_.getMessageOrBuilder();
} else {
return error_ == null ?
io.opencannabis.schema.product.struct.testing.TestValue.TestError.getDefaultInstance() : error_;
}
}
/**
* .opencannabis.structs.labtesting.TestValue.TestError error = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.product.struct.testing.TestValue.TestError, io.opencannabis.schema.product.struct.testing.TestValue.TestError.Builder, io.opencannabis.schema.product.struct.testing.TestValue.TestErrorOrBuilder>
getErrorFieldBuilder() {
if (errorBuilder_ == null) {
errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.opencannabis.schema.product.struct.testing.TestValue.TestError, io.opencannabis.schema.product.struct.testing.TestValue.TestError.Builder, io.opencannabis.schema.product.struct.testing.TestValue.TestErrorOrBuilder>(
getError(),
getParentForChildren(),
isClean());
error_ = null;
}
return errorBuilder_;
}
/**
* double measurement = 10;
*/
public double getMeasurement() {
if (valueCase_ == 10) {
return (java.lang.Double) value_;
}
return 0D;
}
/**
* double measurement = 10;
*/
public Builder setMeasurement(double value) {
valueCase_ = 10;
value_ = value;
onChanged();
return this;
}
/**
* double measurement = 10;
*/
public Builder clearMeasurement() {
if (valueCase_ == 10) {
valueCase_ = 0;
value_ = null;
onChanged();
}
return this;
}
/**
* bool present = 20;
*/
public boolean getPresent() {
if (valueCase_ == 20) {
return (java.lang.Boolean) value_;
}
return false;
}
/**
* bool present = 20;
*/
public Builder setPresent(boolean value) {
valueCase_ = 20;
value_ = value;
onChanged();
return this;
}
/**
* bool present = 20;
*/
public Builder clearPresent() {
if (valueCase_ == 20) {
valueCase_ = 0;
value_ = null;
onChanged();
}
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:opencannabis.structs.labtesting.TestValue)
}
// @@protoc_insertion_point(class_scope:opencannabis.structs.labtesting.TestValue)
private static final io.opencannabis.schema.product.struct.testing.TestValue DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.opencannabis.schema.product.struct.testing.TestValue();
}
public static io.opencannabis.schema.product.struct.testing.TestValue getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public TestValue parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TestValue(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.product.struct.testing.TestValue getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy