org.openlca.proto.ProtoAllocationFactor Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: olca.proto
package org.openlca.proto;
/**
*
* A single allocation factor in a process.
*
*
* Protobuf type {@code protolca.ProtoAllocationFactor}
*/
public final class ProtoAllocationFactor extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:protolca.ProtoAllocationFactor)
ProtoAllocationFactorOrBuilder {
private static final long serialVersionUID = 0L;
// Use ProtoAllocationFactor.newBuilder() to construct.
private ProtoAllocationFactor(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ProtoAllocationFactor() {
allocationType_ = 0;
formula_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new ProtoAllocationFactor();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ProtoAllocationFactor(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
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();
allocationType_ = rawValue;
break;
}
case 18: {
org.openlca.proto.ProtoRef.Builder subBuilder = null;
if (product_ != null) {
subBuilder = product_.toBuilder();
}
product_ = input.readMessage(org.openlca.proto.ProtoRef.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(product_);
product_ = subBuilder.buildPartial();
}
break;
}
case 25: {
value_ = input.readDouble();
break;
}
case 34: {
java.lang.String s = input.readStringRequireUtf8();
formula_ = s;
break;
}
case 42: {
org.openlca.proto.ProtoExchangeRef.Builder subBuilder = null;
if (exchange_ != null) {
subBuilder = exchange_.toBuilder();
}
exchange_ = input.readMessage(org.openlca.proto.ProtoExchangeRef.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(exchange_);
exchange_ = 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 org.openlca.proto.Proto.internal_static_protolca_ProtoAllocationFactor_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.openlca.proto.Proto.internal_static_protolca_ProtoAllocationFactor_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.openlca.proto.ProtoAllocationFactor.class, org.openlca.proto.ProtoAllocationFactor.Builder.class);
}
public static final int ALLOCATION_TYPE_FIELD_NUMBER = 1;
private int allocationType_;
/**
*
* The type of allocation.
*
*
* .protolca.ProtoAllocationType allocation_type = 1;
* @return The enum numeric value on the wire for allocationType.
*/
@java.lang.Override public int getAllocationTypeValue() {
return allocationType_;
}
/**
*
* The type of allocation.
*
*
* .protolca.ProtoAllocationType allocation_type = 1;
* @return The allocationType.
*/
@java.lang.Override public org.openlca.proto.ProtoAllocationType getAllocationType() {
@SuppressWarnings("deprecation")
org.openlca.proto.ProtoAllocationType result = org.openlca.proto.ProtoAllocationType.valueOf(allocationType_);
return result == null ? org.openlca.proto.ProtoAllocationType.UNRECOGNIZED : result;
}
public static final int PRODUCT_FIELD_NUMBER = 2;
private org.openlca.proto.ProtoRef product_;
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
* @return Whether the product field is set.
*/
@java.lang.Override
public boolean hasProduct() {
return product_ != null;
}
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
* @return The product.
*/
@java.lang.Override
public org.openlca.proto.ProtoRef getProduct() {
return product_ == null ? org.openlca.proto.ProtoRef.getDefaultInstance() : product_;
}
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
*/
@java.lang.Override
public org.openlca.proto.ProtoRefOrBuilder getProductOrBuilder() {
return getProduct();
}
public static final int VALUE_FIELD_NUMBER = 3;
private double value_;
/**
*
* The value of the allocation factor.
*
*
* double value = 3;
* @return The value.
*/
@java.lang.Override
public double getValue() {
return value_;
}
public static final int FORMULA_FIELD_NUMBER = 4;
private volatile java.lang.Object formula_;
/**
*
* An optional formula from which the value of the allocation factor is
* calculated.
*
*
* string formula = 4;
* @return The formula.
*/
@java.lang.Override
public java.lang.String getFormula() {
java.lang.Object ref = formula_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
formula_ = s;
return s;
}
}
/**
*
* An optional formula from which the value of the allocation factor is
* calculated.
*
*
* string formula = 4;
* @return The bytes for formula.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getFormulaBytes() {
java.lang.Object ref = formula_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
formula_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int EXCHANGE_FIELD_NUMBER = 5;
private org.openlca.proto.ProtoExchangeRef exchange_;
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
* @return Whether the exchange field is set.
*/
@java.lang.Override
public boolean hasExchange() {
return exchange_ != null;
}
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
* @return The exchange.
*/
@java.lang.Override
public org.openlca.proto.ProtoExchangeRef getExchange() {
return exchange_ == null ? org.openlca.proto.ProtoExchangeRef.getDefaultInstance() : exchange_;
}
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
*/
@java.lang.Override
public org.openlca.proto.ProtoExchangeRefOrBuilder getExchangeOrBuilder() {
return getExchange();
}
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 (allocationType_ != org.openlca.proto.ProtoAllocationType.UNDEFINED_ALLOCATION_TYPE.getNumber()) {
output.writeEnum(1, allocationType_);
}
if (product_ != null) {
output.writeMessage(2, getProduct());
}
if (value_ != 0D) {
output.writeDouble(3, value_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(formula_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, formula_);
}
if (exchange_ != null) {
output.writeMessage(5, getExchange());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (allocationType_ != org.openlca.proto.ProtoAllocationType.UNDEFINED_ALLOCATION_TYPE.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, allocationType_);
}
if (product_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getProduct());
}
if (value_ != 0D) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(3, value_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(formula_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, formula_);
}
if (exchange_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, getExchange());
}
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 org.openlca.proto.ProtoAllocationFactor)) {
return super.equals(obj);
}
org.openlca.proto.ProtoAllocationFactor other = (org.openlca.proto.ProtoAllocationFactor) obj;
if (allocationType_ != other.allocationType_) return false;
if (hasProduct() != other.hasProduct()) return false;
if (hasProduct()) {
if (!getProduct()
.equals(other.getProduct())) return false;
}
if (java.lang.Double.doubleToLongBits(getValue())
!= java.lang.Double.doubleToLongBits(
other.getValue())) return false;
if (!getFormula()
.equals(other.getFormula())) return false;
if (hasExchange() != other.hasExchange()) return false;
if (hasExchange()) {
if (!getExchange()
.equals(other.getExchange())) 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) + ALLOCATION_TYPE_FIELD_NUMBER;
hash = (53 * hash) + allocationType_;
if (hasProduct()) {
hash = (37 * hash) + PRODUCT_FIELD_NUMBER;
hash = (53 * hash) + getProduct().hashCode();
}
hash = (37 * hash) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getValue()));
hash = (37 * hash) + FORMULA_FIELD_NUMBER;
hash = (53 * hash) + getFormula().hashCode();
if (hasExchange()) {
hash = (37 * hash) + EXCHANGE_FIELD_NUMBER;
hash = (53 * hash) + getExchange().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.openlca.proto.ProtoAllocationFactor parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.openlca.proto.ProtoAllocationFactor parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.openlca.proto.ProtoAllocationFactor parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.openlca.proto.ProtoAllocationFactor parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.openlca.proto.ProtoAllocationFactor parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.openlca.proto.ProtoAllocationFactor parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.openlca.proto.ProtoAllocationFactor parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.openlca.proto.ProtoAllocationFactor 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 org.openlca.proto.ProtoAllocationFactor parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.openlca.proto.ProtoAllocationFactor 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 org.openlca.proto.ProtoAllocationFactor parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.openlca.proto.ProtoAllocationFactor 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(org.openlca.proto.ProtoAllocationFactor 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;
}
/**
*
* A single allocation factor in a process.
*
*
* Protobuf type {@code protolca.ProtoAllocationFactor}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:protolca.ProtoAllocationFactor)
org.openlca.proto.ProtoAllocationFactorOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.openlca.proto.Proto.internal_static_protolca_ProtoAllocationFactor_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.openlca.proto.Proto.internal_static_protolca_ProtoAllocationFactor_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.openlca.proto.ProtoAllocationFactor.class, org.openlca.proto.ProtoAllocationFactor.Builder.class);
}
// Construct using org.openlca.proto.ProtoAllocationFactor.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();
allocationType_ = 0;
if (productBuilder_ == null) {
product_ = null;
} else {
product_ = null;
productBuilder_ = null;
}
value_ = 0D;
formula_ = "";
if (exchangeBuilder_ == null) {
exchange_ = null;
} else {
exchange_ = null;
exchangeBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.openlca.proto.Proto.internal_static_protolca_ProtoAllocationFactor_descriptor;
}
@java.lang.Override
public org.openlca.proto.ProtoAllocationFactor getDefaultInstanceForType() {
return org.openlca.proto.ProtoAllocationFactor.getDefaultInstance();
}
@java.lang.Override
public org.openlca.proto.ProtoAllocationFactor build() {
org.openlca.proto.ProtoAllocationFactor result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.openlca.proto.ProtoAllocationFactor buildPartial() {
org.openlca.proto.ProtoAllocationFactor result = new org.openlca.proto.ProtoAllocationFactor(this);
result.allocationType_ = allocationType_;
if (productBuilder_ == null) {
result.product_ = product_;
} else {
result.product_ = productBuilder_.build();
}
result.value_ = value_;
result.formula_ = formula_;
if (exchangeBuilder_ == null) {
result.exchange_ = exchange_;
} else {
result.exchange_ = exchangeBuilder_.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 org.openlca.proto.ProtoAllocationFactor) {
return mergeFrom((org.openlca.proto.ProtoAllocationFactor)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.openlca.proto.ProtoAllocationFactor other) {
if (other == org.openlca.proto.ProtoAllocationFactor.getDefaultInstance()) return this;
if (other.allocationType_ != 0) {
setAllocationTypeValue(other.getAllocationTypeValue());
}
if (other.hasProduct()) {
mergeProduct(other.getProduct());
}
if (other.getValue() != 0D) {
setValue(other.getValue());
}
if (!other.getFormula().isEmpty()) {
formula_ = other.formula_;
onChanged();
}
if (other.hasExchange()) {
mergeExchange(other.getExchange());
}
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 {
org.openlca.proto.ProtoAllocationFactor parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.openlca.proto.ProtoAllocationFactor) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int allocationType_ = 0;
/**
*
* The type of allocation.
*
*
* .protolca.ProtoAllocationType allocation_type = 1;
* @return The enum numeric value on the wire for allocationType.
*/
@java.lang.Override public int getAllocationTypeValue() {
return allocationType_;
}
/**
*
* The type of allocation.
*
*
* .protolca.ProtoAllocationType allocation_type = 1;
* @param value The enum numeric value on the wire for allocationType to set.
* @return This builder for chaining.
*/
public Builder setAllocationTypeValue(int value) {
allocationType_ = value;
onChanged();
return this;
}
/**
*
* The type of allocation.
*
*
* .protolca.ProtoAllocationType allocation_type = 1;
* @return The allocationType.
*/
@java.lang.Override
public org.openlca.proto.ProtoAllocationType getAllocationType() {
@SuppressWarnings("deprecation")
org.openlca.proto.ProtoAllocationType result = org.openlca.proto.ProtoAllocationType.valueOf(allocationType_);
return result == null ? org.openlca.proto.ProtoAllocationType.UNRECOGNIZED : result;
}
/**
*
* The type of allocation.
*
*
* .protolca.ProtoAllocationType allocation_type = 1;
* @param value The allocationType to set.
* @return This builder for chaining.
*/
public Builder setAllocationType(org.openlca.proto.ProtoAllocationType value) {
if (value == null) {
throw new NullPointerException();
}
allocationType_ = value.getNumber();
onChanged();
return this;
}
/**
*
* The type of allocation.
*
*
* .protolca.ProtoAllocationType allocation_type = 1;
* @return This builder for chaining.
*/
public Builder clearAllocationType() {
allocationType_ = 0;
onChanged();
return this;
}
private org.openlca.proto.ProtoRef product_;
private com.google.protobuf.SingleFieldBuilderV3<
org.openlca.proto.ProtoRef, org.openlca.proto.ProtoRef.Builder, org.openlca.proto.ProtoRefOrBuilder> productBuilder_;
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
* @return Whether the product field is set.
*/
public boolean hasProduct() {
return productBuilder_ != null || product_ != null;
}
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
* @return The product.
*/
public org.openlca.proto.ProtoRef getProduct() {
if (productBuilder_ == null) {
return product_ == null ? org.openlca.proto.ProtoRef.getDefaultInstance() : product_;
} else {
return productBuilder_.getMessage();
}
}
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
*/
public Builder setProduct(org.openlca.proto.ProtoRef value) {
if (productBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
product_ = value;
onChanged();
} else {
productBuilder_.setMessage(value);
}
return this;
}
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
*/
public Builder setProduct(
org.openlca.proto.ProtoRef.Builder builderForValue) {
if (productBuilder_ == null) {
product_ = builderForValue.build();
onChanged();
} else {
productBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
*/
public Builder mergeProduct(org.openlca.proto.ProtoRef value) {
if (productBuilder_ == null) {
if (product_ != null) {
product_ =
org.openlca.proto.ProtoRef.newBuilder(product_).mergeFrom(value).buildPartial();
} else {
product_ = value;
}
onChanged();
} else {
productBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
*/
public Builder clearProduct() {
if (productBuilder_ == null) {
product_ = null;
onChanged();
} else {
product_ = null;
productBuilder_ = null;
}
return this;
}
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
*/
public org.openlca.proto.ProtoRef.Builder getProductBuilder() {
onChanged();
return getProductFieldBuilder().getBuilder();
}
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
*/
public org.openlca.proto.ProtoRefOrBuilder getProductOrBuilder() {
if (productBuilder_ != null) {
return productBuilder_.getMessageOrBuilder();
} else {
return product_ == null ?
org.openlca.proto.ProtoRef.getDefaultInstance() : product_;
}
}
/**
*
* The output product (or waste input) to which this allocation factor is
* related. The must be an exchange with this product output (or waste input)
* in this process.
*
*
* .protolca.ProtoRef product = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
org.openlca.proto.ProtoRef, org.openlca.proto.ProtoRef.Builder, org.openlca.proto.ProtoRefOrBuilder>
getProductFieldBuilder() {
if (productBuilder_ == null) {
productBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
org.openlca.proto.ProtoRef, org.openlca.proto.ProtoRef.Builder, org.openlca.proto.ProtoRefOrBuilder>(
getProduct(),
getParentForChildren(),
isClean());
product_ = null;
}
return productBuilder_;
}
private double value_ ;
/**
*
* The value of the allocation factor.
*
*
* double value = 3;
* @return The value.
*/
@java.lang.Override
public double getValue() {
return value_;
}
/**
*
* The value of the allocation factor.
*
*
* double value = 3;
* @param value The value to set.
* @return This builder for chaining.
*/
public Builder setValue(double value) {
value_ = value;
onChanged();
return this;
}
/**
*
* The value of the allocation factor.
*
*
* double value = 3;
* @return This builder for chaining.
*/
public Builder clearValue() {
value_ = 0D;
onChanged();
return this;
}
private java.lang.Object formula_ = "";
/**
*
* An optional formula from which the value of the allocation factor is
* calculated.
*
*
* string formula = 4;
* @return The formula.
*/
public java.lang.String getFormula() {
java.lang.Object ref = formula_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
formula_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* An optional formula from which the value of the allocation factor is
* calculated.
*
*
* string formula = 4;
* @return The bytes for formula.
*/
public com.google.protobuf.ByteString
getFormulaBytes() {
java.lang.Object ref = formula_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
formula_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* An optional formula from which the value of the allocation factor is
* calculated.
*
*
* string formula = 4;
* @param value The formula to set.
* @return This builder for chaining.
*/
public Builder setFormula(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
formula_ = value;
onChanged();
return this;
}
/**
*
* An optional formula from which the value of the allocation factor is
* calculated.
*
*
* string formula = 4;
* @return This builder for chaining.
*/
public Builder clearFormula() {
formula_ = getDefaultInstance().getFormula();
onChanged();
return this;
}
/**
*
* An optional formula from which the value of the allocation factor is
* calculated.
*
*
* string formula = 4;
* @param value The bytes for formula to set.
* @return This builder for chaining.
*/
public Builder setFormulaBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
formula_ = value;
onChanged();
return this;
}
private org.openlca.proto.ProtoExchangeRef exchange_;
private com.google.protobuf.SingleFieldBuilderV3<
org.openlca.proto.ProtoExchangeRef, org.openlca.proto.ProtoExchangeRef.Builder, org.openlca.proto.ProtoExchangeRefOrBuilder> exchangeBuilder_;
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
* @return Whether the exchange field is set.
*/
public boolean hasExchange() {
return exchangeBuilder_ != null || exchange_ != null;
}
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
* @return The exchange.
*/
public org.openlca.proto.ProtoExchangeRef getExchange() {
if (exchangeBuilder_ == null) {
return exchange_ == null ? org.openlca.proto.ProtoExchangeRef.getDefaultInstance() : exchange_;
} else {
return exchangeBuilder_.getMessage();
}
}
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
*/
public Builder setExchange(org.openlca.proto.ProtoExchangeRef value) {
if (exchangeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
exchange_ = value;
onChanged();
} else {
exchangeBuilder_.setMessage(value);
}
return this;
}
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
*/
public Builder setExchange(
org.openlca.proto.ProtoExchangeRef.Builder builderForValue) {
if (exchangeBuilder_ == null) {
exchange_ = builderForValue.build();
onChanged();
} else {
exchangeBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
*/
public Builder mergeExchange(org.openlca.proto.ProtoExchangeRef value) {
if (exchangeBuilder_ == null) {
if (exchange_ != null) {
exchange_ =
org.openlca.proto.ProtoExchangeRef.newBuilder(exchange_).mergeFrom(value).buildPartial();
} else {
exchange_ = value;
}
onChanged();
} else {
exchangeBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
*/
public Builder clearExchange() {
if (exchangeBuilder_ == null) {
exchange_ = null;
onChanged();
} else {
exchange_ = null;
exchangeBuilder_ = null;
}
return this;
}
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
*/
public org.openlca.proto.ProtoExchangeRef.Builder getExchangeBuilder() {
onChanged();
return getExchangeFieldBuilder().getBuilder();
}
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
*/
public org.openlca.proto.ProtoExchangeRefOrBuilder getExchangeOrBuilder() {
if (exchangeBuilder_ != null) {
return exchangeBuilder_.getMessageOrBuilder();
} else {
return exchange_ == null ?
org.openlca.proto.ProtoExchangeRef.getDefaultInstance() : exchange_;
}
}
/**
*
* A product input, waste output, or elementary flow exchange which is
* allocated by this factor. This is only valid for causal allocation where
* allocation factors can be assigned to single exchanges.
*
*
* .protolca.ProtoExchangeRef exchange = 5;
*/
private com.google.protobuf.SingleFieldBuilderV3<
org.openlca.proto.ProtoExchangeRef, org.openlca.proto.ProtoExchangeRef.Builder, org.openlca.proto.ProtoExchangeRefOrBuilder>
getExchangeFieldBuilder() {
if (exchangeBuilder_ == null) {
exchangeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
org.openlca.proto.ProtoExchangeRef, org.openlca.proto.ProtoExchangeRef.Builder, org.openlca.proto.ProtoExchangeRefOrBuilder>(
getExchange(),
getParentForChildren(),
isClean());
exchange_ = null;
}
return exchangeBuilder_;
}
@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:protolca.ProtoAllocationFactor)
}
// @@protoc_insertion_point(class_scope:protolca.ProtoAllocationFactor)
private static final org.openlca.proto.ProtoAllocationFactor DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.openlca.proto.ProtoAllocationFactor();
}
public static org.openlca.proto.ProtoAllocationFactor getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ProtoAllocationFactor parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ProtoAllocationFactor(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 org.openlca.proto.ProtoAllocationFactor getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy