All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.opencannabis.schema.product.struct.testing.Cannabinoids Maven / Gradle / Ivy

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: structs/labtesting/TestResults.proto

package io.opencannabis.schema.product.struct.testing;

/**
 * 
 * Specifies test results with regard to cannabinoid compounds, enumerated in `Cannabinoid`. THC and CBD testing is
 * elevated to a dedicated spot in test results due to its notability as a consumer decision-making signal.
 * 
* * Protobuf type {@code opencannabis.structs.labtesting.Cannabinoids} */ public final class Cannabinoids extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:opencannabis.structs.labtesting.Cannabinoids) CannabinoidsOrBuilder { private static final long serialVersionUID = 0L; // Use Cannabinoids.newBuilder() to construct. private Cannabinoids(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Cannabinoids() { results_ = java.util.Collections.emptyList(); ratio_ = 0; potency_ = 0; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Cannabinoids( 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.product.struct.testing.TestValue.Builder subBuilder = null; if (thc_ != null) { subBuilder = thc_.toBuilder(); } thc_ = input.readMessage(io.opencannabis.schema.product.struct.testing.TestValue.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(thc_); thc_ = subBuilder.buildPartial(); } break; } case 18: { io.opencannabis.schema.product.struct.testing.TestValue.Builder subBuilder = null; if (cbd_ != null) { subBuilder = cbd_.toBuilder(); } cbd_ = input.readMessage(io.opencannabis.schema.product.struct.testing.TestValue.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(cbd_); cbd_ = subBuilder.buildPartial(); } break; } case 26: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { results_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000004; } results_.add( input.readMessage(io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.parser(), extensionRegistry)); break; } case 32: { int rawValue = input.readEnum(); ratio_ = rawValue; break; } case 40: { int rawValue = input.readEnum(); potency_ = rawValue; 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_ & 0x00000004) != 0)) { results_ = java.util.Collections.unmodifiableList(results_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.opencannabis.schema.product.struct.testing.LabTesting.internal_static_opencannabis_structs_labtesting_Cannabinoids_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.opencannabis.schema.product.struct.testing.LabTesting.internal_static_opencannabis_structs_labtesting_Cannabinoids_fieldAccessorTable .ensureFieldAccessorsInitialized( io.opencannabis.schema.product.struct.testing.Cannabinoids.class, io.opencannabis.schema.product.struct.testing.Cannabinoids.Builder.class); } public interface ResultOrBuilder extends // @@protoc_insertion_point(interface_extends:opencannabis.structs.labtesting.Cannabinoids.Result) com.google.protobuf.MessageOrBuilder { /** *
     * Cannabinoid this result is expressing results for.
     * 
* * .opencannabis.structs.labtesting.Cannabinoid cannabinoid = 1; */ int getCannabinoidValue(); /** *
     * Cannabinoid this result is expressing results for.
     * 
* * .opencannabis.structs.labtesting.Cannabinoid cannabinoid = 1; */ io.opencannabis.schema.product.struct.testing.Cannabinoid getCannabinoid(); /** *
     * Measurement value for this individual result.
     * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ boolean hasMeasurement(); /** *
     * Measurement value for this individual result.
     * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ io.opencannabis.schema.product.struct.testing.TestValue getMeasurement(); /** *
     * Measurement value for this individual result.
     * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ io.opencannabis.schema.product.struct.testing.TestValueOrBuilder getMeasurementOrBuilder(); } /** *
   * Individual payload for a cannabinoid test result.
   * 
* * Protobuf type {@code opencannabis.structs.labtesting.Cannabinoids.Result} */ public static final class Result extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:opencannabis.structs.labtesting.Cannabinoids.Result) ResultOrBuilder { private static final long serialVersionUID = 0L; // Use Result.newBuilder() to construct. private Result(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Result() { cannabinoid_ = 0; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Result( 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(); cannabinoid_ = rawValue; break; } case 26: { io.opencannabis.schema.product.struct.testing.TestValue.Builder subBuilder = null; if (measurement_ != null) { subBuilder = measurement_.toBuilder(); } measurement_ = input.readMessage(io.opencannabis.schema.product.struct.testing.TestValue.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(measurement_); measurement_ = subBuilder.buildPartial(); } 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.product.struct.testing.LabTesting.internal_static_opencannabis_structs_labtesting_Cannabinoids_Result_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.opencannabis.schema.product.struct.testing.LabTesting.internal_static_opencannabis_structs_labtesting_Cannabinoids_Result_fieldAccessorTable .ensureFieldAccessorsInitialized( io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.class, io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder.class); } public static final int CANNABINOID_FIELD_NUMBER = 1; private int cannabinoid_; /** *
     * Cannabinoid this result is expressing results for.
     * 
* * .opencannabis.structs.labtesting.Cannabinoid cannabinoid = 1; */ public int getCannabinoidValue() { return cannabinoid_; } /** *
     * Cannabinoid this result is expressing results for.
     * 
* * .opencannabis.structs.labtesting.Cannabinoid cannabinoid = 1; */ public io.opencannabis.schema.product.struct.testing.Cannabinoid getCannabinoid() { @SuppressWarnings("deprecation") io.opencannabis.schema.product.struct.testing.Cannabinoid result = io.opencannabis.schema.product.struct.testing.Cannabinoid.valueOf(cannabinoid_); return result == null ? io.opencannabis.schema.product.struct.testing.Cannabinoid.UNRECOGNIZED : result; } public static final int MEASUREMENT_FIELD_NUMBER = 3; private io.opencannabis.schema.product.struct.testing.TestValue measurement_; /** *
     * Measurement value for this individual result.
     * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public boolean hasMeasurement() { return measurement_ != null; } /** *
     * Measurement value for this individual result.
     * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public io.opencannabis.schema.product.struct.testing.TestValue getMeasurement() { return measurement_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance() : measurement_; } /** *
     * Measurement value for this individual result.
     * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public io.opencannabis.schema.product.struct.testing.TestValueOrBuilder getMeasurementOrBuilder() { return getMeasurement(); } 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 (cannabinoid_ != io.opencannabis.schema.product.struct.testing.Cannabinoid.THC.getNumber()) { output.writeEnum(1, cannabinoid_); } if (measurement_ != null) { output.writeMessage(3, getMeasurement()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (cannabinoid_ != io.opencannabis.schema.product.struct.testing.Cannabinoid.THC.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, cannabinoid_); } if (measurement_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getMeasurement()); } 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.Cannabinoids.Result)) { return super.equals(obj); } io.opencannabis.schema.product.struct.testing.Cannabinoids.Result other = (io.opencannabis.schema.product.struct.testing.Cannabinoids.Result) obj; if (cannabinoid_ != other.cannabinoid_) return false; if (hasMeasurement() != other.hasMeasurement()) return false; if (hasMeasurement()) { if (!getMeasurement() .equals(other.getMeasurement())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CANNABINOID_FIELD_NUMBER; hash = (53 * hash) + cannabinoid_; if (hasMeasurement()) { hash = (37 * hash) + MEASUREMENT_FIELD_NUMBER; hash = (53 * hash) + getMeasurement().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static io.opencannabis.schema.product.struct.testing.Cannabinoids.Result parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.product.struct.testing.Cannabinoids.Result 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.Cannabinoids.Result parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.product.struct.testing.Cannabinoids.Result 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.Cannabinoids.Result parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.product.struct.testing.Cannabinoids.Result 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.Cannabinoids.Result 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.Cannabinoids.Result 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.Cannabinoids.Result 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.Cannabinoids.Result 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.Cannabinoids.Result 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.Cannabinoids.Result 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.Cannabinoids.Result 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; } /** *
     * Individual payload for a cannabinoid test result.
     * 
* * Protobuf type {@code opencannabis.structs.labtesting.Cannabinoids.Result} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:opencannabis.structs.labtesting.Cannabinoids.Result) io.opencannabis.schema.product.struct.testing.Cannabinoids.ResultOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.opencannabis.schema.product.struct.testing.LabTesting.internal_static_opencannabis_structs_labtesting_Cannabinoids_Result_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.opencannabis.schema.product.struct.testing.LabTesting.internal_static_opencannabis_structs_labtesting_Cannabinoids_Result_fieldAccessorTable .ensureFieldAccessorsInitialized( io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.class, io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder.class); } // Construct using io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.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(); cannabinoid_ = 0; if (measurementBuilder_ == null) { measurement_ = null; } else { measurement_ = null; measurementBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return io.opencannabis.schema.product.struct.testing.LabTesting.internal_static_opencannabis_structs_labtesting_Cannabinoids_Result_descriptor; } @java.lang.Override public io.opencannabis.schema.product.struct.testing.Cannabinoids.Result getDefaultInstanceForType() { return io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.getDefaultInstance(); } @java.lang.Override public io.opencannabis.schema.product.struct.testing.Cannabinoids.Result build() { io.opencannabis.schema.product.struct.testing.Cannabinoids.Result result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public io.opencannabis.schema.product.struct.testing.Cannabinoids.Result buildPartial() { io.opencannabis.schema.product.struct.testing.Cannabinoids.Result result = new io.opencannabis.schema.product.struct.testing.Cannabinoids.Result(this); result.cannabinoid_ = cannabinoid_; if (measurementBuilder_ == null) { result.measurement_ = measurement_; } else { result.measurement_ = measurementBuilder_.build(); } 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.product.struct.testing.Cannabinoids.Result) { return mergeFrom((io.opencannabis.schema.product.struct.testing.Cannabinoids.Result)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.opencannabis.schema.product.struct.testing.Cannabinoids.Result other) { if (other == io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.getDefaultInstance()) return this; if (other.cannabinoid_ != 0) { setCannabinoidValue(other.getCannabinoidValue()); } if (other.hasMeasurement()) { mergeMeasurement(other.getMeasurement()); } 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.Cannabinoids.Result parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (io.opencannabis.schema.product.struct.testing.Cannabinoids.Result) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int cannabinoid_ = 0; /** *
       * Cannabinoid this result is expressing results for.
       * 
* * .opencannabis.structs.labtesting.Cannabinoid cannabinoid = 1; */ public int getCannabinoidValue() { return cannabinoid_; } /** *
       * Cannabinoid this result is expressing results for.
       * 
* * .opencannabis.structs.labtesting.Cannabinoid cannabinoid = 1; */ public Builder setCannabinoidValue(int value) { cannabinoid_ = value; onChanged(); return this; } /** *
       * Cannabinoid this result is expressing results for.
       * 
* * .opencannabis.structs.labtesting.Cannabinoid cannabinoid = 1; */ public io.opencannabis.schema.product.struct.testing.Cannabinoid getCannabinoid() { @SuppressWarnings("deprecation") io.opencannabis.schema.product.struct.testing.Cannabinoid result = io.opencannabis.schema.product.struct.testing.Cannabinoid.valueOf(cannabinoid_); return result == null ? io.opencannabis.schema.product.struct.testing.Cannabinoid.UNRECOGNIZED : result; } /** *
       * Cannabinoid this result is expressing results for.
       * 
* * .opencannabis.structs.labtesting.Cannabinoid cannabinoid = 1; */ public Builder setCannabinoid(io.opencannabis.schema.product.struct.testing.Cannabinoid value) { if (value == null) { throw new NullPointerException(); } cannabinoid_ = value.getNumber(); onChanged(); return this; } /** *
       * Cannabinoid this result is expressing results for.
       * 
* * .opencannabis.structs.labtesting.Cannabinoid cannabinoid = 1; */ public Builder clearCannabinoid() { cannabinoid_ = 0; onChanged(); return this; } private io.opencannabis.schema.product.struct.testing.TestValue measurement_; private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.product.struct.testing.TestValue, io.opencannabis.schema.product.struct.testing.TestValue.Builder, io.opencannabis.schema.product.struct.testing.TestValueOrBuilder> measurementBuilder_; /** *
       * Measurement value for this individual result.
       * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public boolean hasMeasurement() { return measurementBuilder_ != null || measurement_ != null; } /** *
       * Measurement value for this individual result.
       * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public io.opencannabis.schema.product.struct.testing.TestValue getMeasurement() { if (measurementBuilder_ == null) { return measurement_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance() : measurement_; } else { return measurementBuilder_.getMessage(); } } /** *
       * Measurement value for this individual result.
       * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public Builder setMeasurement(io.opencannabis.schema.product.struct.testing.TestValue value) { if (measurementBuilder_ == null) { if (value == null) { throw new NullPointerException(); } measurement_ = value; onChanged(); } else { measurementBuilder_.setMessage(value); } return this; } /** *
       * Measurement value for this individual result.
       * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public Builder setMeasurement( io.opencannabis.schema.product.struct.testing.TestValue.Builder builderForValue) { if (measurementBuilder_ == null) { measurement_ = builderForValue.build(); onChanged(); } else { measurementBuilder_.setMessage(builderForValue.build()); } return this; } /** *
       * Measurement value for this individual result.
       * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public Builder mergeMeasurement(io.opencannabis.schema.product.struct.testing.TestValue value) { if (measurementBuilder_ == null) { if (measurement_ != null) { measurement_ = io.opencannabis.schema.product.struct.testing.TestValue.newBuilder(measurement_).mergeFrom(value).buildPartial(); } else { measurement_ = value; } onChanged(); } else { measurementBuilder_.mergeFrom(value); } return this; } /** *
       * Measurement value for this individual result.
       * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public Builder clearMeasurement() { if (measurementBuilder_ == null) { measurement_ = null; onChanged(); } else { measurement_ = null; measurementBuilder_ = null; } return this; } /** *
       * Measurement value for this individual result.
       * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public io.opencannabis.schema.product.struct.testing.TestValue.Builder getMeasurementBuilder() { onChanged(); return getMeasurementFieldBuilder().getBuilder(); } /** *
       * Measurement value for this individual result.
       * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ public io.opencannabis.schema.product.struct.testing.TestValueOrBuilder getMeasurementOrBuilder() { if (measurementBuilder_ != null) { return measurementBuilder_.getMessageOrBuilder(); } else { return measurement_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance() : measurement_; } } /** *
       * Measurement value for this individual result.
       * 
* * .opencannabis.structs.labtesting.TestValue measurement = 3; */ private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.product.struct.testing.TestValue, io.opencannabis.schema.product.struct.testing.TestValue.Builder, io.opencannabis.schema.product.struct.testing.TestValueOrBuilder> getMeasurementFieldBuilder() { if (measurementBuilder_ == null) { measurementBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.product.struct.testing.TestValue, io.opencannabis.schema.product.struct.testing.TestValue.Builder, io.opencannabis.schema.product.struct.testing.TestValueOrBuilder>( getMeasurement(), getParentForChildren(), isClean()); measurement_ = null; } return measurementBuilder_; } @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.structs.labtesting.Cannabinoids.Result) } // @@protoc_insertion_point(class_scope:opencannabis.structs.labtesting.Cannabinoids.Result) private static final io.opencannabis.schema.product.struct.testing.Cannabinoids.Result DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.opencannabis.schema.product.struct.testing.Cannabinoids.Result(); } public static io.opencannabis.schema.product.struct.testing.Cannabinoids.Result getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Result parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Result(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.Cannabinoids.Result getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private int bitField0_; public static final int THC_FIELD_NUMBER = 1; private io.opencannabis.schema.product.struct.testing.TestValue thc_; /** *
   * THC testing value.
   * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public boolean hasThc() { return thc_ != null; } /** *
   * THC testing value.
   * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public io.opencannabis.schema.product.struct.testing.TestValue getThc() { return thc_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance() : thc_; } /** *
   * THC testing value.
   * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public io.opencannabis.schema.product.struct.testing.TestValueOrBuilder getThcOrBuilder() { return getThc(); } public static final int CBD_FIELD_NUMBER = 2; private io.opencannabis.schema.product.struct.testing.TestValue cbd_; /** *
   * CBD testing value.
   * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public boolean hasCbd() { return cbd_ != null; } /** *
   * CBD testing value.
   * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public io.opencannabis.schema.product.struct.testing.TestValue getCbd() { return cbd_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance() : cbd_; } /** *
   * CBD testing value.
   * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public io.opencannabis.schema.product.struct.testing.TestValueOrBuilder getCbdOrBuilder() { return getCbd(); } public static final int RESULTS_FIELD_NUMBER = 3; private java.util.List results_; /** *
   * Individual results payloads for other cannabinoids.
   * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public java.util.List getResultsList() { return results_; } /** *
   * Individual results payloads for other cannabinoids.
   * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public java.util.List getResultsOrBuilderList() { return results_; } /** *
   * Individual results payloads for other cannabinoids.
   * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public int getResultsCount() { return results_.size(); } /** *
   * Individual results payloads for other cannabinoids.
   * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public io.opencannabis.schema.product.struct.testing.Cannabinoids.Result getResults(int index) { return results_.get(index); } /** *
   * Individual results payloads for other cannabinoids.
   * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public io.opencannabis.schema.product.struct.testing.Cannabinoids.ResultOrBuilder getResultsOrBuilder( int index) { return results_.get(index); } public static final int RATIO_FIELD_NUMBER = 4; private int ratio_; /** *
   * Overall THC to CBD ratio, calculated if underlying data is available.
   * 
* * .opencannabis.structs.labtesting.CannabinoidRatio ratio = 4; */ public int getRatioValue() { return ratio_; } /** *
   * Overall THC to CBD ratio, calculated if underlying data is available.
   * 
* * .opencannabis.structs.labtesting.CannabinoidRatio ratio = 4; */ public io.opencannabis.schema.product.struct.testing.CannabinoidRatio getRatio() { @SuppressWarnings("deprecation") io.opencannabis.schema.product.struct.testing.CannabinoidRatio result = io.opencannabis.schema.product.struct.testing.CannabinoidRatio.valueOf(ratio_); return result == null ? io.opencannabis.schema.product.struct.testing.CannabinoidRatio.UNRECOGNIZED : result; } public static final int POTENCY_FIELD_NUMBER = 5; private int potency_; /** *
   * Calculated potency estimate, based on this product's type/kind and test results.
   * 
* * .opencannabis.structs.labtesting.PotencyEstimate potency = 5; */ public int getPotencyValue() { return potency_; } /** *
   * Calculated potency estimate, based on this product's type/kind and test results.
   * 
* * .opencannabis.structs.labtesting.PotencyEstimate potency = 5; */ public io.opencannabis.schema.product.struct.testing.PotencyEstimate getPotency() { @SuppressWarnings("deprecation") io.opencannabis.schema.product.struct.testing.PotencyEstimate result = io.opencannabis.schema.product.struct.testing.PotencyEstimate.valueOf(potency_); return result == null ? io.opencannabis.schema.product.struct.testing.PotencyEstimate.UNRECOGNIZED : result; } 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 (thc_ != null) { output.writeMessage(1, getThc()); } if (cbd_ != null) { output.writeMessage(2, getCbd()); } for (int i = 0; i < results_.size(); i++) { output.writeMessage(3, results_.get(i)); } if (ratio_ != io.opencannabis.schema.product.struct.testing.CannabinoidRatio.NO_CANNABINOID_PREFERENCE.getNumber()) { output.writeEnum(4, ratio_); } if (potency_ != io.opencannabis.schema.product.struct.testing.PotencyEstimate.LIGHT.getNumber()) { output.writeEnum(5, potency_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (thc_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getThc()); } if (cbd_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getCbd()); } for (int i = 0; i < results_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, results_.get(i)); } if (ratio_ != io.opencannabis.schema.product.struct.testing.CannabinoidRatio.NO_CANNABINOID_PREFERENCE.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(4, ratio_); } if (potency_ != io.opencannabis.schema.product.struct.testing.PotencyEstimate.LIGHT.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(5, potency_); } 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.Cannabinoids)) { return super.equals(obj); } io.opencannabis.schema.product.struct.testing.Cannabinoids other = (io.opencannabis.schema.product.struct.testing.Cannabinoids) obj; if (hasThc() != other.hasThc()) return false; if (hasThc()) { if (!getThc() .equals(other.getThc())) return false; } if (hasCbd() != other.hasCbd()) return false; if (hasCbd()) { if (!getCbd() .equals(other.getCbd())) return false; } if (!getResultsList() .equals(other.getResultsList())) return false; if (ratio_ != other.ratio_) return false; if (potency_ != other.potency_) 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 (hasThc()) { hash = (37 * hash) + THC_FIELD_NUMBER; hash = (53 * hash) + getThc().hashCode(); } if (hasCbd()) { hash = (37 * hash) + CBD_FIELD_NUMBER; hash = (53 * hash) + getCbd().hashCode(); } if (getResultsCount() > 0) { hash = (37 * hash) + RESULTS_FIELD_NUMBER; hash = (53 * hash) + getResultsList().hashCode(); } hash = (37 * hash) + RATIO_FIELD_NUMBER; hash = (53 * hash) + ratio_; hash = (37 * hash) + POTENCY_FIELD_NUMBER; hash = (53 * hash) + potency_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static io.opencannabis.schema.product.struct.testing.Cannabinoids parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.product.struct.testing.Cannabinoids 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.Cannabinoids parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.product.struct.testing.Cannabinoids 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.Cannabinoids parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencannabis.schema.product.struct.testing.Cannabinoids 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.Cannabinoids 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.Cannabinoids 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.Cannabinoids 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.Cannabinoids 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.Cannabinoids 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.Cannabinoids 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.Cannabinoids 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 test results with regard to cannabinoid compounds, enumerated in `Cannabinoid`. THC and CBD testing is
   * elevated to a dedicated spot in test results due to its notability as a consumer decision-making signal.
   * 
* * Protobuf type {@code opencannabis.structs.labtesting.Cannabinoids} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:opencannabis.structs.labtesting.Cannabinoids) io.opencannabis.schema.product.struct.testing.CannabinoidsOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.opencannabis.schema.product.struct.testing.LabTesting.internal_static_opencannabis_structs_labtesting_Cannabinoids_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.opencannabis.schema.product.struct.testing.LabTesting.internal_static_opencannabis_structs_labtesting_Cannabinoids_fieldAccessorTable .ensureFieldAccessorsInitialized( io.opencannabis.schema.product.struct.testing.Cannabinoids.class, io.opencannabis.schema.product.struct.testing.Cannabinoids.Builder.class); } // Construct using io.opencannabis.schema.product.struct.testing.Cannabinoids.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getResultsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); if (thcBuilder_ == null) { thc_ = null; } else { thc_ = null; thcBuilder_ = null; } if (cbdBuilder_ == null) { cbd_ = null; } else { cbd_ = null; cbdBuilder_ = null; } if (resultsBuilder_ == null) { results_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); } else { resultsBuilder_.clear(); } ratio_ = 0; potency_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return io.opencannabis.schema.product.struct.testing.LabTesting.internal_static_opencannabis_structs_labtesting_Cannabinoids_descriptor; } @java.lang.Override public io.opencannabis.schema.product.struct.testing.Cannabinoids getDefaultInstanceForType() { return io.opencannabis.schema.product.struct.testing.Cannabinoids.getDefaultInstance(); } @java.lang.Override public io.opencannabis.schema.product.struct.testing.Cannabinoids build() { io.opencannabis.schema.product.struct.testing.Cannabinoids result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public io.opencannabis.schema.product.struct.testing.Cannabinoids buildPartial() { io.opencannabis.schema.product.struct.testing.Cannabinoids result = new io.opencannabis.schema.product.struct.testing.Cannabinoids(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (thcBuilder_ == null) { result.thc_ = thc_; } else { result.thc_ = thcBuilder_.build(); } if (cbdBuilder_ == null) { result.cbd_ = cbd_; } else { result.cbd_ = cbdBuilder_.build(); } if (resultsBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0)) { results_ = java.util.Collections.unmodifiableList(results_); bitField0_ = (bitField0_ & ~0x00000004); } result.results_ = results_; } else { result.results_ = resultsBuilder_.build(); } result.ratio_ = ratio_; result.potency_ = potency_; 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.product.struct.testing.Cannabinoids) { return mergeFrom((io.opencannabis.schema.product.struct.testing.Cannabinoids)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.opencannabis.schema.product.struct.testing.Cannabinoids other) { if (other == io.opencannabis.schema.product.struct.testing.Cannabinoids.getDefaultInstance()) return this; if (other.hasThc()) { mergeThc(other.getThc()); } if (other.hasCbd()) { mergeCbd(other.getCbd()); } if (resultsBuilder_ == null) { if (!other.results_.isEmpty()) { if (results_.isEmpty()) { results_ = other.results_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureResultsIsMutable(); results_.addAll(other.results_); } onChanged(); } } else { if (!other.results_.isEmpty()) { if (resultsBuilder_.isEmpty()) { resultsBuilder_.dispose(); resultsBuilder_ = null; results_ = other.results_; bitField0_ = (bitField0_ & ~0x00000004); resultsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getResultsFieldBuilder() : null; } else { resultsBuilder_.addAllMessages(other.results_); } } } if (other.ratio_ != 0) { setRatioValue(other.getRatioValue()); } if (other.potency_ != 0) { setPotencyValue(other.getPotencyValue()); } 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.Cannabinoids parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (io.opencannabis.schema.product.struct.testing.Cannabinoids) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private io.opencannabis.schema.product.struct.testing.TestValue thc_; private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.product.struct.testing.TestValue, io.opencannabis.schema.product.struct.testing.TestValue.Builder, io.opencannabis.schema.product.struct.testing.TestValueOrBuilder> thcBuilder_; /** *
     * THC testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public boolean hasThc() { return thcBuilder_ != null || thc_ != null; } /** *
     * THC testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public io.opencannabis.schema.product.struct.testing.TestValue getThc() { if (thcBuilder_ == null) { return thc_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance() : thc_; } else { return thcBuilder_.getMessage(); } } /** *
     * THC testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public Builder setThc(io.opencannabis.schema.product.struct.testing.TestValue value) { if (thcBuilder_ == null) { if (value == null) { throw new NullPointerException(); } thc_ = value; onChanged(); } else { thcBuilder_.setMessage(value); } return this; } /** *
     * THC testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public Builder setThc( io.opencannabis.schema.product.struct.testing.TestValue.Builder builderForValue) { if (thcBuilder_ == null) { thc_ = builderForValue.build(); onChanged(); } else { thcBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * THC testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public Builder mergeThc(io.opencannabis.schema.product.struct.testing.TestValue value) { if (thcBuilder_ == null) { if (thc_ != null) { thc_ = io.opencannabis.schema.product.struct.testing.TestValue.newBuilder(thc_).mergeFrom(value).buildPartial(); } else { thc_ = value; } onChanged(); } else { thcBuilder_.mergeFrom(value); } return this; } /** *
     * THC testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public Builder clearThc() { if (thcBuilder_ == null) { thc_ = null; onChanged(); } else { thc_ = null; thcBuilder_ = null; } return this; } /** *
     * THC testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public io.opencannabis.schema.product.struct.testing.TestValue.Builder getThcBuilder() { onChanged(); return getThcFieldBuilder().getBuilder(); } /** *
     * THC testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ public io.opencannabis.schema.product.struct.testing.TestValueOrBuilder getThcOrBuilder() { if (thcBuilder_ != null) { return thcBuilder_.getMessageOrBuilder(); } else { return thc_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance() : thc_; } } /** *
     * THC testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue thc = 1; */ private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.product.struct.testing.TestValue, io.opencannabis.schema.product.struct.testing.TestValue.Builder, io.opencannabis.schema.product.struct.testing.TestValueOrBuilder> getThcFieldBuilder() { if (thcBuilder_ == null) { thcBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.product.struct.testing.TestValue, io.opencannabis.schema.product.struct.testing.TestValue.Builder, io.opencannabis.schema.product.struct.testing.TestValueOrBuilder>( getThc(), getParentForChildren(), isClean()); thc_ = null; } return thcBuilder_; } private io.opencannabis.schema.product.struct.testing.TestValue cbd_; private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.product.struct.testing.TestValue, io.opencannabis.schema.product.struct.testing.TestValue.Builder, io.opencannabis.schema.product.struct.testing.TestValueOrBuilder> cbdBuilder_; /** *
     * CBD testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public boolean hasCbd() { return cbdBuilder_ != null || cbd_ != null; } /** *
     * CBD testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public io.opencannabis.schema.product.struct.testing.TestValue getCbd() { if (cbdBuilder_ == null) { return cbd_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance() : cbd_; } else { return cbdBuilder_.getMessage(); } } /** *
     * CBD testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public Builder setCbd(io.opencannabis.schema.product.struct.testing.TestValue value) { if (cbdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } cbd_ = value; onChanged(); } else { cbdBuilder_.setMessage(value); } return this; } /** *
     * CBD testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public Builder setCbd( io.opencannabis.schema.product.struct.testing.TestValue.Builder builderForValue) { if (cbdBuilder_ == null) { cbd_ = builderForValue.build(); onChanged(); } else { cbdBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * CBD testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public Builder mergeCbd(io.opencannabis.schema.product.struct.testing.TestValue value) { if (cbdBuilder_ == null) { if (cbd_ != null) { cbd_ = io.opencannabis.schema.product.struct.testing.TestValue.newBuilder(cbd_).mergeFrom(value).buildPartial(); } else { cbd_ = value; } onChanged(); } else { cbdBuilder_.mergeFrom(value); } return this; } /** *
     * CBD testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public Builder clearCbd() { if (cbdBuilder_ == null) { cbd_ = null; onChanged(); } else { cbd_ = null; cbdBuilder_ = null; } return this; } /** *
     * CBD testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public io.opencannabis.schema.product.struct.testing.TestValue.Builder getCbdBuilder() { onChanged(); return getCbdFieldBuilder().getBuilder(); } /** *
     * CBD testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ public io.opencannabis.schema.product.struct.testing.TestValueOrBuilder getCbdOrBuilder() { if (cbdBuilder_ != null) { return cbdBuilder_.getMessageOrBuilder(); } else { return cbd_ == null ? io.opencannabis.schema.product.struct.testing.TestValue.getDefaultInstance() : cbd_; } } /** *
     * CBD testing value.
     * 
* * .opencannabis.structs.labtesting.TestValue cbd = 2; */ private com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.product.struct.testing.TestValue, io.opencannabis.schema.product.struct.testing.TestValue.Builder, io.opencannabis.schema.product.struct.testing.TestValueOrBuilder> getCbdFieldBuilder() { if (cbdBuilder_ == null) { cbdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.opencannabis.schema.product.struct.testing.TestValue, io.opencannabis.schema.product.struct.testing.TestValue.Builder, io.opencannabis.schema.product.struct.testing.TestValueOrBuilder>( getCbd(), getParentForChildren(), isClean()); cbd_ = null; } return cbdBuilder_; } private java.util.List results_ = java.util.Collections.emptyList(); private void ensureResultsIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { results_ = new java.util.ArrayList(results_); bitField0_ |= 0x00000004; } } private com.google.protobuf.RepeatedFieldBuilderV3< io.opencannabis.schema.product.struct.testing.Cannabinoids.Result, io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder, io.opencannabis.schema.product.struct.testing.Cannabinoids.ResultOrBuilder> resultsBuilder_; /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public java.util.List getResultsList() { if (resultsBuilder_ == null) { return java.util.Collections.unmodifiableList(results_); } else { return resultsBuilder_.getMessageList(); } } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public int getResultsCount() { if (resultsBuilder_ == null) { return results_.size(); } else { return resultsBuilder_.getCount(); } } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public io.opencannabis.schema.product.struct.testing.Cannabinoids.Result getResults(int index) { if (resultsBuilder_ == null) { return results_.get(index); } else { return resultsBuilder_.getMessage(index); } } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public Builder setResults( int index, io.opencannabis.schema.product.struct.testing.Cannabinoids.Result value) { if (resultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureResultsIsMutable(); results_.set(index, value); onChanged(); } else { resultsBuilder_.setMessage(index, value); } return this; } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public Builder setResults( int index, io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder builderForValue) { if (resultsBuilder_ == null) { ensureResultsIsMutable(); results_.set(index, builderForValue.build()); onChanged(); } else { resultsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public Builder addResults(io.opencannabis.schema.product.struct.testing.Cannabinoids.Result value) { if (resultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureResultsIsMutable(); results_.add(value); onChanged(); } else { resultsBuilder_.addMessage(value); } return this; } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public Builder addResults( int index, io.opencannabis.schema.product.struct.testing.Cannabinoids.Result value) { if (resultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureResultsIsMutable(); results_.add(index, value); onChanged(); } else { resultsBuilder_.addMessage(index, value); } return this; } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public Builder addResults( io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder builderForValue) { if (resultsBuilder_ == null) { ensureResultsIsMutable(); results_.add(builderForValue.build()); onChanged(); } else { resultsBuilder_.addMessage(builderForValue.build()); } return this; } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public Builder addResults( int index, io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder builderForValue) { if (resultsBuilder_ == null) { ensureResultsIsMutable(); results_.add(index, builderForValue.build()); onChanged(); } else { resultsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public Builder addAllResults( java.lang.Iterable values) { if (resultsBuilder_ == null) { ensureResultsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, results_); onChanged(); } else { resultsBuilder_.addAllMessages(values); } return this; } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public Builder clearResults() { if (resultsBuilder_ == null) { results_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { resultsBuilder_.clear(); } return this; } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public Builder removeResults(int index) { if (resultsBuilder_ == null) { ensureResultsIsMutable(); results_.remove(index); onChanged(); } else { resultsBuilder_.remove(index); } return this; } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder getResultsBuilder( int index) { return getResultsFieldBuilder().getBuilder(index); } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public io.opencannabis.schema.product.struct.testing.Cannabinoids.ResultOrBuilder getResultsOrBuilder( int index) { if (resultsBuilder_ == null) { return results_.get(index); } else { return resultsBuilder_.getMessageOrBuilder(index); } } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public java.util.List getResultsOrBuilderList() { if (resultsBuilder_ != null) { return resultsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(results_); } } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder addResultsBuilder() { return getResultsFieldBuilder().addBuilder( io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.getDefaultInstance()); } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder addResultsBuilder( int index) { return getResultsFieldBuilder().addBuilder( index, io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.getDefaultInstance()); } /** *
     * Individual results payloads for other cannabinoids.
     * 
* * repeated .opencannabis.structs.labtesting.Cannabinoids.Result results = 3; */ public java.util.List getResultsBuilderList() { return getResultsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< io.opencannabis.schema.product.struct.testing.Cannabinoids.Result, io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder, io.opencannabis.schema.product.struct.testing.Cannabinoids.ResultOrBuilder> getResultsFieldBuilder() { if (resultsBuilder_ == null) { resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< io.opencannabis.schema.product.struct.testing.Cannabinoids.Result, io.opencannabis.schema.product.struct.testing.Cannabinoids.Result.Builder, io.opencannabis.schema.product.struct.testing.Cannabinoids.ResultOrBuilder>( results_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); results_ = null; } return resultsBuilder_; } private int ratio_ = 0; /** *
     * Overall THC to CBD ratio, calculated if underlying data is available.
     * 
* * .opencannabis.structs.labtesting.CannabinoidRatio ratio = 4; */ public int getRatioValue() { return ratio_; } /** *
     * Overall THC to CBD ratio, calculated if underlying data is available.
     * 
* * .opencannabis.structs.labtesting.CannabinoidRatio ratio = 4; */ public Builder setRatioValue(int value) { ratio_ = value; onChanged(); return this; } /** *
     * Overall THC to CBD ratio, calculated if underlying data is available.
     * 
* * .opencannabis.structs.labtesting.CannabinoidRatio ratio = 4; */ public io.opencannabis.schema.product.struct.testing.CannabinoidRatio getRatio() { @SuppressWarnings("deprecation") io.opencannabis.schema.product.struct.testing.CannabinoidRatio result = io.opencannabis.schema.product.struct.testing.CannabinoidRatio.valueOf(ratio_); return result == null ? io.opencannabis.schema.product.struct.testing.CannabinoidRatio.UNRECOGNIZED : result; } /** *
     * Overall THC to CBD ratio, calculated if underlying data is available.
     * 
* * .opencannabis.structs.labtesting.CannabinoidRatio ratio = 4; */ public Builder setRatio(io.opencannabis.schema.product.struct.testing.CannabinoidRatio value) { if (value == null) { throw new NullPointerException(); } ratio_ = value.getNumber(); onChanged(); return this; } /** *
     * Overall THC to CBD ratio, calculated if underlying data is available.
     * 
* * .opencannabis.structs.labtesting.CannabinoidRatio ratio = 4; */ public Builder clearRatio() { ratio_ = 0; onChanged(); return this; } private int potency_ = 0; /** *
     * Calculated potency estimate, based on this product's type/kind and test results.
     * 
* * .opencannabis.structs.labtesting.PotencyEstimate potency = 5; */ public int getPotencyValue() { return potency_; } /** *
     * Calculated potency estimate, based on this product's type/kind and test results.
     * 
* * .opencannabis.structs.labtesting.PotencyEstimate potency = 5; */ public Builder setPotencyValue(int value) { potency_ = value; onChanged(); return this; } /** *
     * Calculated potency estimate, based on this product's type/kind and test results.
     * 
* * .opencannabis.structs.labtesting.PotencyEstimate potency = 5; */ public io.opencannabis.schema.product.struct.testing.PotencyEstimate getPotency() { @SuppressWarnings("deprecation") io.opencannabis.schema.product.struct.testing.PotencyEstimate result = io.opencannabis.schema.product.struct.testing.PotencyEstimate.valueOf(potency_); return result == null ? io.opencannabis.schema.product.struct.testing.PotencyEstimate.UNRECOGNIZED : result; } /** *
     * Calculated potency estimate, based on this product's type/kind and test results.
     * 
* * .opencannabis.structs.labtesting.PotencyEstimate potency = 5; */ public Builder setPotency(io.opencannabis.schema.product.struct.testing.PotencyEstimate value) { if (value == null) { throw new NullPointerException(); } potency_ = value.getNumber(); onChanged(); return this; } /** *
     * Calculated potency estimate, based on this product's type/kind and test results.
     * 
* * .opencannabis.structs.labtesting.PotencyEstimate potency = 5; */ public Builder clearPotency() { potency_ = 0; 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.structs.labtesting.Cannabinoids) } // @@protoc_insertion_point(class_scope:opencannabis.structs.labtesting.Cannabinoids) private static final io.opencannabis.schema.product.struct.testing.Cannabinoids DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.opencannabis.schema.product.struct.testing.Cannabinoids(); } public static io.opencannabis.schema.product.struct.testing.Cannabinoids getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Cannabinoids parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Cannabinoids(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.Cannabinoids getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy