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

com.google.ortools.linearsolver.MPModelDeltaProto Maven / Gradle / Ivy

The newest version!
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: ortools/linear_solver/linear_solver.proto

package com.google.ortools.linearsolver;

/**
 * 
 * Encodes a full MPModelProto by way of referencing to a "baseline"
 * MPModelProto stored in a file, and a "delta" to apply to this model.
 * 
* * Protobuf type {@code operations_research.MPModelDeltaProto} */ public final class MPModelDeltaProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:operations_research.MPModelDeltaProto) MPModelDeltaProtoOrBuilder { private static final long serialVersionUID = 0L; // Use MPModelDeltaProto.newBuilder() to construct. private MPModelDeltaProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private MPModelDeltaProto() { baselineModelFilePath_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new MPModelDeltaProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private MPModelDeltaProto( 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: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000001; baselineModelFilePath_ = bs; break; } case 18: { if (!((mutable_bitField0_ & 0x00000002) != 0)) { variableOverrides_ = com.google.protobuf.MapField.newMapField( VariableOverridesDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000002; } com.google.protobuf.MapEntry variableOverrides__ = input.readMessage( VariableOverridesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); variableOverrides_.getMutableMap().put( variableOverrides__.getKey(), variableOverrides__.getValue()); break; } case 26: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { constraintOverrides_ = com.google.protobuf.MapField.newMapField( ConstraintOverridesDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000004; } com.google.protobuf.MapEntry constraintOverrides__ = input.readMessage( ConstraintOverridesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); constraintOverrides_.getMutableMap().put( constraintOverrides__.getKey(), constraintOverrides__.getValue()); 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 com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPModelDeltaProto_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override protected com.google.protobuf.MapField internalGetMapField( int number) { switch (number) { case 2: return internalGetVariableOverrides(); case 3: return internalGetConstraintOverrides(); default: throw new RuntimeException( "Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPModelDeltaProto_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.ortools.linearsolver.MPModelDeltaProto.class, com.google.ortools.linearsolver.MPModelDeltaProto.Builder.class); } private int bitField0_; public static final int BASELINE_MODEL_FILE_PATH_FIELD_NUMBER = 1; private volatile java.lang.Object baselineModelFilePath_; /** * optional string baseline_model_file_path = 1; * @return Whether the baselineModelFilePath field is set. */ @java.lang.Override public boolean hasBaselineModelFilePath() { return ((bitField0_ & 0x00000001) != 0); } /** * optional string baseline_model_file_path = 1; * @return The baselineModelFilePath. */ @java.lang.Override public java.lang.String getBaselineModelFilePath() { java.lang.Object ref = baselineModelFilePath_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { baselineModelFilePath_ = s; } return s; } } /** * optional string baseline_model_file_path = 1; * @return The bytes for baselineModelFilePath. */ @java.lang.Override public com.google.protobuf.ByteString getBaselineModelFilePathBytes() { java.lang.Object ref = baselineModelFilePath_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); baselineModelFilePath_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int VARIABLE_OVERRIDES_FIELD_NUMBER = 2; private static final class VariableOverridesDefaultEntryHolder { static final com.google.protobuf.MapEntry< java.lang.Integer, com.google.ortools.linearsolver.MPVariableProto> defaultEntry = com.google.protobuf.MapEntry .newDefaultInstance( com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPModelDeltaProto_VariableOverridesEntry_descriptor, com.google.protobuf.WireFormat.FieldType.INT32, 0, com.google.protobuf.WireFormat.FieldType.MESSAGE, com.google.ortools.linearsolver.MPVariableProto.getDefaultInstance()); } private com.google.protobuf.MapField< java.lang.Integer, com.google.ortools.linearsolver.MPVariableProto> variableOverrides_; private com.google.protobuf.MapField internalGetVariableOverrides() { if (variableOverrides_ == null) { return com.google.protobuf.MapField.emptyMapField( VariableOverridesDefaultEntryHolder.defaultEntry); } return variableOverrides_; } public int getVariableOverridesCount() { return internalGetVariableOverrides().getMap().size(); } /** *
   * The variable protos listed here will override (via MergeFrom()) the ones
   * in the baseline model: you only need to specify the fields that change.
   * To add a new variable, add it with a new variable index (variable indices
   * still need to span a dense integer interval).
   * You can't "delete" a variable but you can "neutralize" it by fixing its
   * value, setting its objective coefficient to zero, and by nullifying all
   * the terms involving it in the constraints.
   * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ @java.lang.Override public boolean containsVariableOverrides( int key) { return internalGetVariableOverrides().getMap().containsKey(key); } /** * Use {@link #getVariableOverridesMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getVariableOverrides() { return getVariableOverridesMap(); } /** *
   * The variable protos listed here will override (via MergeFrom()) the ones
   * in the baseline model: you only need to specify the fields that change.
   * To add a new variable, add it with a new variable index (variable indices
   * still need to span a dense integer interval).
   * You can't "delete" a variable but you can "neutralize" it by fixing its
   * value, setting its objective coefficient to zero, and by nullifying all
   * the terms involving it in the constraints.
   * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ @java.lang.Override public java.util.Map getVariableOverridesMap() { return internalGetVariableOverrides().getMap(); } /** *
   * The variable protos listed here will override (via MergeFrom()) the ones
   * in the baseline model: you only need to specify the fields that change.
   * To add a new variable, add it with a new variable index (variable indices
   * still need to span a dense integer interval).
   * You can't "delete" a variable but you can "neutralize" it by fixing its
   * value, setting its objective coefficient to zero, and by nullifying all
   * the terms involving it in the constraints.
   * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ @java.lang.Override public com.google.ortools.linearsolver.MPVariableProto getVariableOverridesOrDefault( int key, com.google.ortools.linearsolver.MPVariableProto defaultValue) { java.util.Map map = internalGetVariableOverrides().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** *
   * The variable protos listed here will override (via MergeFrom()) the ones
   * in the baseline model: you only need to specify the fields that change.
   * To add a new variable, add it with a new variable index (variable indices
   * still need to span a dense integer interval).
   * You can't "delete" a variable but you can "neutralize" it by fixing its
   * value, setting its objective coefficient to zero, and by nullifying all
   * the terms involving it in the constraints.
   * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ @java.lang.Override public com.google.ortools.linearsolver.MPVariableProto getVariableOverridesOrThrow( int key) { java.util.Map map = internalGetVariableOverrides().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int CONSTRAINT_OVERRIDES_FIELD_NUMBER = 3; private static final class ConstraintOverridesDefaultEntryHolder { static final com.google.protobuf.MapEntry< java.lang.Integer, com.google.ortools.linearsolver.MPConstraintProto> defaultEntry = com.google.protobuf.MapEntry .newDefaultInstance( com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPModelDeltaProto_ConstraintOverridesEntry_descriptor, com.google.protobuf.WireFormat.FieldType.INT32, 0, com.google.protobuf.WireFormat.FieldType.MESSAGE, com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance()); } private com.google.protobuf.MapField< java.lang.Integer, com.google.ortools.linearsolver.MPConstraintProto> constraintOverrides_; private com.google.protobuf.MapField internalGetConstraintOverrides() { if (constraintOverrides_ == null) { return com.google.protobuf.MapField.emptyMapField( ConstraintOverridesDefaultEntryHolder.defaultEntry); } return constraintOverrides_; } public int getConstraintOverridesCount() { return internalGetConstraintOverrides().getMap().size(); } /** *
   * Constraints can be changed (or added) in the same way as variables, see
   * above. It's mostly like applying MergeFrom(), except that:
   * - the "var_index" and "coefficient" fields will be overridden like a map:
   *   if a key pre-exists, we overwrite its value, otherwise we add it.
   * - if you set the lower bound to -inf and the upper bound to +inf, thus
   *   effectively neutralizing the constraint, the solver will implicitly
   *   remove all of the constraint's terms.
   * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ @java.lang.Override public boolean containsConstraintOverrides( int key) { return internalGetConstraintOverrides().getMap().containsKey(key); } /** * Use {@link #getConstraintOverridesMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getConstraintOverrides() { return getConstraintOverridesMap(); } /** *
   * Constraints can be changed (or added) in the same way as variables, see
   * above. It's mostly like applying MergeFrom(), except that:
   * - the "var_index" and "coefficient" fields will be overridden like a map:
   *   if a key pre-exists, we overwrite its value, otherwise we add it.
   * - if you set the lower bound to -inf and the upper bound to +inf, thus
   *   effectively neutralizing the constraint, the solver will implicitly
   *   remove all of the constraint's terms.
   * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ @java.lang.Override public java.util.Map getConstraintOverridesMap() { return internalGetConstraintOverrides().getMap(); } /** *
   * Constraints can be changed (or added) in the same way as variables, see
   * above. It's mostly like applying MergeFrom(), except that:
   * - the "var_index" and "coefficient" fields will be overridden like a map:
   *   if a key pre-exists, we overwrite its value, otherwise we add it.
   * - if you set the lower bound to -inf and the upper bound to +inf, thus
   *   effectively neutralizing the constraint, the solver will implicitly
   *   remove all of the constraint's terms.
   * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ @java.lang.Override public com.google.ortools.linearsolver.MPConstraintProto getConstraintOverridesOrDefault( int key, com.google.ortools.linearsolver.MPConstraintProto defaultValue) { java.util.Map map = internalGetConstraintOverrides().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** *
   * Constraints can be changed (or added) in the same way as variables, see
   * above. It's mostly like applying MergeFrom(), except that:
   * - the "var_index" and "coefficient" fields will be overridden like a map:
   *   if a key pre-exists, we overwrite its value, otherwise we add it.
   * - if you set the lower bound to -inf and the upper bound to +inf, thus
   *   effectively neutralizing the constraint, the solver will implicitly
   *   remove all of the constraint's terms.
   * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ @java.lang.Override public com.google.ortools.linearsolver.MPConstraintProto getConstraintOverridesOrThrow( int key) { java.util.Map map = internalGetConstraintOverrides().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } 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 (((bitField0_ & 0x00000001) != 0)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, baselineModelFilePath_); } com.google.protobuf.GeneratedMessageV3 .serializeIntegerMapTo( output, internalGetVariableOverrides(), VariableOverridesDefaultEntryHolder.defaultEntry, 2); com.google.protobuf.GeneratedMessageV3 .serializeIntegerMapTo( output, internalGetConstraintOverrides(), ConstraintOverridesDefaultEntryHolder.defaultEntry, 3); unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, baselineModelFilePath_); } for (java.util.Map.Entry entry : internalGetVariableOverrides().getMap().entrySet()) { com.google.protobuf.MapEntry variableOverrides__ = VariableOverridesDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, variableOverrides__); } for (java.util.Map.Entry entry : internalGetConstraintOverrides().getMap().entrySet()) { com.google.protobuf.MapEntry constraintOverrides__ = ConstraintOverridesDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, constraintOverrides__); } 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 com.google.ortools.linearsolver.MPModelDeltaProto)) { return super.equals(obj); } com.google.ortools.linearsolver.MPModelDeltaProto other = (com.google.ortools.linearsolver.MPModelDeltaProto) obj; if (hasBaselineModelFilePath() != other.hasBaselineModelFilePath()) return false; if (hasBaselineModelFilePath()) { if (!getBaselineModelFilePath() .equals(other.getBaselineModelFilePath())) return false; } if (!internalGetVariableOverrides().equals( other.internalGetVariableOverrides())) return false; if (!internalGetConstraintOverrides().equals( other.internalGetConstraintOverrides())) 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 (hasBaselineModelFilePath()) { hash = (37 * hash) + BASELINE_MODEL_FILE_PATH_FIELD_NUMBER; hash = (53 * hash) + getBaselineModelFilePath().hashCode(); } if (!internalGetVariableOverrides().getMap().isEmpty()) { hash = (37 * hash) + VARIABLE_OVERRIDES_FIELD_NUMBER; hash = (53 * hash) + internalGetVariableOverrides().hashCode(); } if (!internalGetConstraintOverrides().getMap().isEmpty()) { hash = (37 * hash) + CONSTRAINT_OVERRIDES_FIELD_NUMBER; hash = (53 * hash) + internalGetConstraintOverrides().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.ortools.linearsolver.MPModelDeltaProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ortools.linearsolver.MPModelDeltaProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ortools.linearsolver.MPModelDeltaProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ortools.linearsolver.MPModelDeltaProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ortools.linearsolver.MPModelDeltaProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ortools.linearsolver.MPModelDeltaProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ortools.linearsolver.MPModelDeltaProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.ortools.linearsolver.MPModelDeltaProto 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 com.google.ortools.linearsolver.MPModelDeltaProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.ortools.linearsolver.MPModelDeltaProto 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 com.google.ortools.linearsolver.MPModelDeltaProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.ortools.linearsolver.MPModelDeltaProto 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(com.google.ortools.linearsolver.MPModelDeltaProto 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; } /** *
   * Encodes a full MPModelProto by way of referencing to a "baseline"
   * MPModelProto stored in a file, and a "delta" to apply to this model.
   * 
* * Protobuf type {@code operations_research.MPModelDeltaProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:operations_research.MPModelDeltaProto) com.google.ortools.linearsolver.MPModelDeltaProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPModelDeltaProto_descriptor; } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMapField( int number) { switch (number) { case 2: return internalGetVariableOverrides(); case 3: return internalGetConstraintOverrides(); default: throw new RuntimeException( "Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMutableMapField( int number) { switch (number) { case 2: return internalGetMutableVariableOverrides(); case 3: return internalGetMutableConstraintOverrides(); default: throw new RuntimeException( "Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPModelDeltaProto_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.ortools.linearsolver.MPModelDeltaProto.class, com.google.ortools.linearsolver.MPModelDeltaProto.Builder.class); } // Construct using com.google.ortools.linearsolver.MPModelDeltaProto.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(); baselineModelFilePath_ = ""; bitField0_ = (bitField0_ & ~0x00000001); internalGetMutableVariableOverrides().clear(); internalGetMutableConstraintOverrides().clear(); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPModelDeltaProto_descriptor; } @java.lang.Override public com.google.ortools.linearsolver.MPModelDeltaProto getDefaultInstanceForType() { return com.google.ortools.linearsolver.MPModelDeltaProto.getDefaultInstance(); } @java.lang.Override public com.google.ortools.linearsolver.MPModelDeltaProto build() { com.google.ortools.linearsolver.MPModelDeltaProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.ortools.linearsolver.MPModelDeltaProto buildPartial() { com.google.ortools.linearsolver.MPModelDeltaProto result = new com.google.ortools.linearsolver.MPModelDeltaProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { to_bitField0_ |= 0x00000001; } result.baselineModelFilePath_ = baselineModelFilePath_; result.variableOverrides_ = internalGetVariableOverrides(); result.variableOverrides_.makeImmutable(); result.constraintOverrides_ = internalGetConstraintOverrides(); result.constraintOverrides_.makeImmutable(); 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 com.google.ortools.linearsolver.MPModelDeltaProto) { return mergeFrom((com.google.ortools.linearsolver.MPModelDeltaProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.ortools.linearsolver.MPModelDeltaProto other) { if (other == com.google.ortools.linearsolver.MPModelDeltaProto.getDefaultInstance()) return this; if (other.hasBaselineModelFilePath()) { bitField0_ |= 0x00000001; baselineModelFilePath_ = other.baselineModelFilePath_; onChanged(); } internalGetMutableVariableOverrides().mergeFrom( other.internalGetVariableOverrides()); internalGetMutableConstraintOverrides().mergeFrom( other.internalGetConstraintOverrides()); 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 { com.google.ortools.linearsolver.MPModelDeltaProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.ortools.linearsolver.MPModelDeltaProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private java.lang.Object baselineModelFilePath_ = ""; /** * optional string baseline_model_file_path = 1; * @return Whether the baselineModelFilePath field is set. */ public boolean hasBaselineModelFilePath() { return ((bitField0_ & 0x00000001) != 0); } /** * optional string baseline_model_file_path = 1; * @return The baselineModelFilePath. */ public java.lang.String getBaselineModelFilePath() { java.lang.Object ref = baselineModelFilePath_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { baselineModelFilePath_ = s; } return s; } else { return (java.lang.String) ref; } } /** * optional string baseline_model_file_path = 1; * @return The bytes for baselineModelFilePath. */ public com.google.protobuf.ByteString getBaselineModelFilePathBytes() { java.lang.Object ref = baselineModelFilePath_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); baselineModelFilePath_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * optional string baseline_model_file_path = 1; * @param value The baselineModelFilePath to set. * @return This builder for chaining. */ public Builder setBaselineModelFilePath( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; baselineModelFilePath_ = value; onChanged(); return this; } /** * optional string baseline_model_file_path = 1; * @return This builder for chaining. */ public Builder clearBaselineModelFilePath() { bitField0_ = (bitField0_ & ~0x00000001); baselineModelFilePath_ = getDefaultInstance().getBaselineModelFilePath(); onChanged(); return this; } /** * optional string baseline_model_file_path = 1; * @param value The bytes for baselineModelFilePath to set. * @return This builder for chaining. */ public Builder setBaselineModelFilePathBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; baselineModelFilePath_ = value; onChanged(); return this; } private com.google.protobuf.MapField< java.lang.Integer, com.google.ortools.linearsolver.MPVariableProto> variableOverrides_; private com.google.protobuf.MapField internalGetVariableOverrides() { if (variableOverrides_ == null) { return com.google.protobuf.MapField.emptyMapField( VariableOverridesDefaultEntryHolder.defaultEntry); } return variableOverrides_; } private com.google.protobuf.MapField internalGetMutableVariableOverrides() { onChanged();; if (variableOverrides_ == null) { variableOverrides_ = com.google.protobuf.MapField.newMapField( VariableOverridesDefaultEntryHolder.defaultEntry); } if (!variableOverrides_.isMutable()) { variableOverrides_ = variableOverrides_.copy(); } return variableOverrides_; } public int getVariableOverridesCount() { return internalGetVariableOverrides().getMap().size(); } /** *
     * The variable protos listed here will override (via MergeFrom()) the ones
     * in the baseline model: you only need to specify the fields that change.
     * To add a new variable, add it with a new variable index (variable indices
     * still need to span a dense integer interval).
     * You can't "delete" a variable but you can "neutralize" it by fixing its
     * value, setting its objective coefficient to zero, and by nullifying all
     * the terms involving it in the constraints.
     * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ @java.lang.Override public boolean containsVariableOverrides( int key) { return internalGetVariableOverrides().getMap().containsKey(key); } /** * Use {@link #getVariableOverridesMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getVariableOverrides() { return getVariableOverridesMap(); } /** *
     * The variable protos listed here will override (via MergeFrom()) the ones
     * in the baseline model: you only need to specify the fields that change.
     * To add a new variable, add it with a new variable index (variable indices
     * still need to span a dense integer interval).
     * You can't "delete" a variable but you can "neutralize" it by fixing its
     * value, setting its objective coefficient to zero, and by nullifying all
     * the terms involving it in the constraints.
     * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ @java.lang.Override public java.util.Map getVariableOverridesMap() { return internalGetVariableOverrides().getMap(); } /** *
     * The variable protos listed here will override (via MergeFrom()) the ones
     * in the baseline model: you only need to specify the fields that change.
     * To add a new variable, add it with a new variable index (variable indices
     * still need to span a dense integer interval).
     * You can't "delete" a variable but you can "neutralize" it by fixing its
     * value, setting its objective coefficient to zero, and by nullifying all
     * the terms involving it in the constraints.
     * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ @java.lang.Override public com.google.ortools.linearsolver.MPVariableProto getVariableOverridesOrDefault( int key, com.google.ortools.linearsolver.MPVariableProto defaultValue) { java.util.Map map = internalGetVariableOverrides().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** *
     * The variable protos listed here will override (via MergeFrom()) the ones
     * in the baseline model: you only need to specify the fields that change.
     * To add a new variable, add it with a new variable index (variable indices
     * still need to span a dense integer interval).
     * You can't "delete" a variable but you can "neutralize" it by fixing its
     * value, setting its objective coefficient to zero, and by nullifying all
     * the terms involving it in the constraints.
     * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ @java.lang.Override public com.google.ortools.linearsolver.MPVariableProto getVariableOverridesOrThrow( int key) { java.util.Map map = internalGetVariableOverrides().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearVariableOverrides() { internalGetMutableVariableOverrides().getMutableMap() .clear(); return this; } /** *
     * The variable protos listed here will override (via MergeFrom()) the ones
     * in the baseline model: you only need to specify the fields that change.
     * To add a new variable, add it with a new variable index (variable indices
     * still need to span a dense integer interval).
     * You can't "delete" a variable but you can "neutralize" it by fixing its
     * value, setting its objective coefficient to zero, and by nullifying all
     * the terms involving it in the constraints.
     * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ public Builder removeVariableOverrides( int key) { internalGetMutableVariableOverrides().getMutableMap() .remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableVariableOverrides() { return internalGetMutableVariableOverrides().getMutableMap(); } /** *
     * The variable protos listed here will override (via MergeFrom()) the ones
     * in the baseline model: you only need to specify the fields that change.
     * To add a new variable, add it with a new variable index (variable indices
     * still need to span a dense integer interval).
     * You can't "delete" a variable but you can "neutralize" it by fixing its
     * value, setting its objective coefficient to zero, and by nullifying all
     * the terms involving it in the constraints.
     * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ public Builder putVariableOverrides( int key, com.google.ortools.linearsolver.MPVariableProto value) { if (value == null) { throw new java.lang.NullPointerException(); } internalGetMutableVariableOverrides().getMutableMap() .put(key, value); return this; } /** *
     * The variable protos listed here will override (via MergeFrom()) the ones
     * in the baseline model: you only need to specify the fields that change.
     * To add a new variable, add it with a new variable index (variable indices
     * still need to span a dense integer interval).
     * You can't "delete" a variable but you can "neutralize" it by fixing its
     * value, setting its objective coefficient to zero, and by nullifying all
     * the terms involving it in the constraints.
     * 
* * map<int32, .operations_research.MPVariableProto> variable_overrides = 2; */ public Builder putAllVariableOverrides( java.util.Map values) { internalGetMutableVariableOverrides().getMutableMap() .putAll(values); return this; } private com.google.protobuf.MapField< java.lang.Integer, com.google.ortools.linearsolver.MPConstraintProto> constraintOverrides_; private com.google.protobuf.MapField internalGetConstraintOverrides() { if (constraintOverrides_ == null) { return com.google.protobuf.MapField.emptyMapField( ConstraintOverridesDefaultEntryHolder.defaultEntry); } return constraintOverrides_; } private com.google.protobuf.MapField internalGetMutableConstraintOverrides() { onChanged();; if (constraintOverrides_ == null) { constraintOverrides_ = com.google.protobuf.MapField.newMapField( ConstraintOverridesDefaultEntryHolder.defaultEntry); } if (!constraintOverrides_.isMutable()) { constraintOverrides_ = constraintOverrides_.copy(); } return constraintOverrides_; } public int getConstraintOverridesCount() { return internalGetConstraintOverrides().getMap().size(); } /** *
     * Constraints can be changed (or added) in the same way as variables, see
     * above. It's mostly like applying MergeFrom(), except that:
     * - the "var_index" and "coefficient" fields will be overridden like a map:
     *   if a key pre-exists, we overwrite its value, otherwise we add it.
     * - if you set the lower bound to -inf and the upper bound to +inf, thus
     *   effectively neutralizing the constraint, the solver will implicitly
     *   remove all of the constraint's terms.
     * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ @java.lang.Override public boolean containsConstraintOverrides( int key) { return internalGetConstraintOverrides().getMap().containsKey(key); } /** * Use {@link #getConstraintOverridesMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getConstraintOverrides() { return getConstraintOverridesMap(); } /** *
     * Constraints can be changed (or added) in the same way as variables, see
     * above. It's mostly like applying MergeFrom(), except that:
     * - the "var_index" and "coefficient" fields will be overridden like a map:
     *   if a key pre-exists, we overwrite its value, otherwise we add it.
     * - if you set the lower bound to -inf and the upper bound to +inf, thus
     *   effectively neutralizing the constraint, the solver will implicitly
     *   remove all of the constraint's terms.
     * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ @java.lang.Override public java.util.Map getConstraintOverridesMap() { return internalGetConstraintOverrides().getMap(); } /** *
     * Constraints can be changed (or added) in the same way as variables, see
     * above. It's mostly like applying MergeFrom(), except that:
     * - the "var_index" and "coefficient" fields will be overridden like a map:
     *   if a key pre-exists, we overwrite its value, otherwise we add it.
     * - if you set the lower bound to -inf and the upper bound to +inf, thus
     *   effectively neutralizing the constraint, the solver will implicitly
     *   remove all of the constraint's terms.
     * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ @java.lang.Override public com.google.ortools.linearsolver.MPConstraintProto getConstraintOverridesOrDefault( int key, com.google.ortools.linearsolver.MPConstraintProto defaultValue) { java.util.Map map = internalGetConstraintOverrides().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** *
     * Constraints can be changed (or added) in the same way as variables, see
     * above. It's mostly like applying MergeFrom(), except that:
     * - the "var_index" and "coefficient" fields will be overridden like a map:
     *   if a key pre-exists, we overwrite its value, otherwise we add it.
     * - if you set the lower bound to -inf and the upper bound to +inf, thus
     *   effectively neutralizing the constraint, the solver will implicitly
     *   remove all of the constraint's terms.
     * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ @java.lang.Override public com.google.ortools.linearsolver.MPConstraintProto getConstraintOverridesOrThrow( int key) { java.util.Map map = internalGetConstraintOverrides().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearConstraintOverrides() { internalGetMutableConstraintOverrides().getMutableMap() .clear(); return this; } /** *
     * Constraints can be changed (or added) in the same way as variables, see
     * above. It's mostly like applying MergeFrom(), except that:
     * - the "var_index" and "coefficient" fields will be overridden like a map:
     *   if a key pre-exists, we overwrite its value, otherwise we add it.
     * - if you set the lower bound to -inf and the upper bound to +inf, thus
     *   effectively neutralizing the constraint, the solver will implicitly
     *   remove all of the constraint's terms.
     * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ public Builder removeConstraintOverrides( int key) { internalGetMutableConstraintOverrides().getMutableMap() .remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableConstraintOverrides() { return internalGetMutableConstraintOverrides().getMutableMap(); } /** *
     * Constraints can be changed (or added) in the same way as variables, see
     * above. It's mostly like applying MergeFrom(), except that:
     * - the "var_index" and "coefficient" fields will be overridden like a map:
     *   if a key pre-exists, we overwrite its value, otherwise we add it.
     * - if you set the lower bound to -inf and the upper bound to +inf, thus
     *   effectively neutralizing the constraint, the solver will implicitly
     *   remove all of the constraint's terms.
     * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ public Builder putConstraintOverrides( int key, com.google.ortools.linearsolver.MPConstraintProto value) { if (value == null) { throw new java.lang.NullPointerException(); } internalGetMutableConstraintOverrides().getMutableMap() .put(key, value); return this; } /** *
     * Constraints can be changed (or added) in the same way as variables, see
     * above. It's mostly like applying MergeFrom(), except that:
     * - the "var_index" and "coefficient" fields will be overridden like a map:
     *   if a key pre-exists, we overwrite its value, otherwise we add it.
     * - if you set the lower bound to -inf and the upper bound to +inf, thus
     *   effectively neutralizing the constraint, the solver will implicitly
     *   remove all of the constraint's terms.
     * 
* * map<int32, .operations_research.MPConstraintProto> constraint_overrides = 3; */ public Builder putAllConstraintOverrides( java.util.Map values) { internalGetMutableConstraintOverrides().getMutableMap() .putAll(values); 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:operations_research.MPModelDeltaProto) } // @@protoc_insertion_point(class_scope:operations_research.MPModelDeltaProto) private static final com.google.ortools.linearsolver.MPModelDeltaProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.ortools.linearsolver.MPModelDeltaProto(); } public static com.google.ortools.linearsolver.MPModelDeltaProto getDefaultInstance() { return DEFAULT_INSTANCE; } @java.lang.Deprecated public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public MPModelDeltaProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new MPModelDeltaProto(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 com.google.ortools.linearsolver.MPModelDeltaProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy