6package com.google.ortools.linearsolver;
21@com.google.protobuf.Generated
22public final class MPIndicatorConstraint
extends
23 com.google.protobuf.GeneratedMessage implements
26private static final long serialVersionUID = 0L;
28 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
29 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
34 MPIndicatorConstraint.class.getName());
37 private MPIndicatorConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
40 private MPIndicatorConstraint() {
43 public static final com.google.protobuf.Descriptors.Descriptor
45 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPIndicatorConstraint_descriptor;
49 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
51 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPIndicatorConstraint_fieldAccessorTable
52 .ensureFieldAccessorsInitialized(
53 com.google.ortools.linearsolver.MPIndicatorConstraint.class, com.google.ortools.linearsolver.MPIndicatorConstraint.Builder.class);
56 private int bitField0_;
58 private int varIndex_ = 0;
70 return ((bitField0_ & 0x00000001) != 0);
87 private int varValue_ = 0;
98 return ((bitField0_ & 0x00000002) != 0);
125 return ((bitField0_ & 0x00000004) != 0);
137 return constraint_ ==
null ? com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance() : constraint_;
148 return constraint_ ==
null ? com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance() : constraint_;
151 private byte memoizedIsInitialized = -1;
158 memoizedIsInitialized = 1;
163 public void writeTo(com.google.protobuf.CodedOutputStream output)
164 throws java.io.IOException {
165 if (((bitField0_ & 0x00000001) != 0)) {
166 output.writeInt32(1, varIndex_);
168 if (((bitField0_ & 0x00000002) != 0)) {
169 output.writeInt32(2, varValue_);
171 if (((bitField0_ & 0x00000004) != 0)) {
174 getUnknownFields().writeTo(output);
179 int size = memoizedSize;
180 if (size != -1)
return size;
183 if (((bitField0_ & 0x00000001) != 0)) {
184 size += com.google.protobuf.CodedOutputStream
185 .computeInt32Size(1, varIndex_);
187 if (((bitField0_ & 0x00000002) != 0)) {
188 size += com.google.protobuf.CodedOutputStream
189 .computeInt32Size(2, varValue_);
191 if (((bitField0_ & 0x00000004) != 0)) {
192 size += com.google.protobuf.CodedOutputStream
195 size += getUnknownFields().getSerializedSize();
201 public boolean equals(
final java.lang.Object obj) {
205 if (!(obj instanceof com.google.ortools.linearsolver.MPIndicatorConstraint)) {
206 return super.equals(obj);
225 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
231 if (memoizedHashCode != 0) {
232 return memoizedHashCode;
248 hash = (29 * hash) + getUnknownFields().hashCode();
249 memoizedHashCode = hash;
254 java.nio.ByteBuffer data)
255 throws com.google.protobuf.InvalidProtocolBufferException {
256 return PARSER.parseFrom(data);
259 java.nio.ByteBuffer data,
260 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
261 throws com.google.protobuf.InvalidProtocolBufferException {
262 return PARSER.parseFrom(data, extensionRegistry);
265 com.google.protobuf.ByteString data)
266 throws com.google.protobuf.InvalidProtocolBufferException {
267 return PARSER.parseFrom(data);
270 com.google.protobuf.ByteString data,
271 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
272 throws com.google.protobuf.InvalidProtocolBufferException {
273 return PARSER.parseFrom(data, extensionRegistry);
276 throws com.google.protobuf.InvalidProtocolBufferException {
277 return PARSER.parseFrom(data);
281 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
282 throws com.google.protobuf.InvalidProtocolBufferException {
283 return PARSER.parseFrom(data, extensionRegistry);
286 throws java.io.IOException {
287 return com.google.protobuf.GeneratedMessage
288 .parseWithIOException(PARSER, input);
291 java.io.InputStream input,
292 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
293 throws java.io.IOException {
294 return com.google.protobuf.GeneratedMessage
295 .parseWithIOException(PARSER, input, extensionRegistry);
299 throws java.io.IOException {
300 return com.google.protobuf.GeneratedMessage
301 .parseDelimitedWithIOException(PARSER, input);
305 java.io.InputStream input,
306 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
307 throws java.io.IOException {
308 return com.google.protobuf.GeneratedMessage
309 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
312 com.google.protobuf.CodedInputStream input)
313 throws java.io.IOException {
314 return com.google.protobuf.GeneratedMessage
315 .parseWithIOException(PARSER, input);
318 com.google.protobuf.CodedInputStream input,
319 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
320 throws java.io.IOException {
321 return com.google.protobuf.GeneratedMessage
322 .parseWithIOException(PARSER, input, extensionRegistry);
328 return DEFAULT_INSTANCE.toBuilder();
330 public static Builder newBuilder(com.google.ortools.linearsolver.MPIndicatorConstraint prototype) {
331 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
335 return this == DEFAULT_INSTANCE
341 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
358 public static final class Builder
extends
359 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
362 public static final com.google.protobuf.Descriptors.Descriptor
364 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPIndicatorConstraint_descriptor;
368 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
370 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPIndicatorConstraint_fieldAccessorTable
371 .ensureFieldAccessorsInitialized(
372 com.google.ortools.linearsolver.MPIndicatorConstraint.class, com.google.ortools.linearsolver.MPIndicatorConstraint.Builder.class);
377 maybeForceBuilderInitialization();
381 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
383 maybeForceBuilderInitialization();
385 private void maybeForceBuilderInitialization() {
386 if (com.google.protobuf.GeneratedMessage
387 .alwaysUseFieldBuilders) {
388 internalGetConstraintFieldBuilder();
398 if (constraintBuilder_ !=
null) {
399 constraintBuilder_.dispose();
400 constraintBuilder_ =
null;
406 public com.google.protobuf.Descriptors.Descriptor
408 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPIndicatorConstraint_descriptor;
413 return com.google.ortools.linearsolver.MPIndicatorConstraint.getDefaultInstance();
420 throw newUninitializedMessageException(result);
428 if (bitField0_ != 0) { buildPartial0(result); }
433 private void buildPartial0(com.google.ortools.linearsolver.MPIndicatorConstraint result) {
434 int from_bitField0_ = bitField0_;
435 int to_bitField0_ = 0;
436 if (((from_bitField0_ & 0x00000001) != 0)) {
437 result.varIndex_ = varIndex_;
438 to_bitField0_ |= 0x00000001;
440 if (((from_bitField0_ & 0x00000002) != 0)) {
441 result.varValue_ = varValue_;
442 to_bitField0_ |= 0x00000002;
444 if (((from_bitField0_ & 0x00000004) != 0)) {
445 result.constraint_ = constraintBuilder_ ==
null
447 : constraintBuilder_.build();
448 to_bitField0_ |= 0x00000004;
450 result.bitField0_ |= to_bitField0_;
454 public Builder
mergeFrom(com.google.protobuf.Message other) {
455 if (other instanceof com.google.ortools.linearsolver.MPIndicatorConstraint) {
456 return mergeFrom((com.google.ortools.linearsolver.MPIndicatorConstraint)other);
458 super.mergeFrom(other);
463 public Builder
mergeFrom(com.google.ortools.linearsolver.MPIndicatorConstraint other) {
464 if (other == com.google.ortools.linearsolver.MPIndicatorConstraint.getDefaultInstance())
return this;
465 if (other.hasVarIndex()) {
468 if (other.hasVarValue()) {
471 if (other.hasConstraint()) {
474 this.mergeUnknownFields(other.getUnknownFields());
486 com.google.protobuf.CodedInputStream input,
487 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
488 throws java.io.IOException {
489 if (extensionRegistry ==
null) {
490 throw new java.lang.NullPointerException();
493 boolean done =
false;
495 int tag = input.readTag();
501 varIndex_ = input.readInt32();
502 bitField0_ |= 0x00000001;
506 varValue_ = input.readInt32();
507 bitField0_ |= 0x00000002;
512 internalGetConstraintFieldBuilder().getBuilder(),
514 bitField0_ |= 0x00000004;
518 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
525 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
526 throw e.unwrapIOException();
532 private int bitField0_;
534 private int varIndex_ ;
546 return ((bitField0_ & 0x00000001) != 0);
574 bitField0_ |= 0x00000001;
588 bitField0_ = (bitField0_ & ~0x00000001);
594 private int varValue_ ;
605 return ((bitField0_ & 0x00000002) != 0);
631 bitField0_ |= 0x00000002;
644 bitField0_ = (bitField0_ & ~0x00000002);
651 private com.google.protobuf.SingleFieldBuilder<
652 com.google.ortools.linearsolver.MPConstraintProto, com.google.ortools.linearsolver.MPConstraintProto.Builder, com.google.ortools.linearsolver.MPConstraintProtoOrBuilder> constraintBuilder_;
662 return ((bitField0_ & 0x00000004) != 0);
673 if (constraintBuilder_ ==
null) {
674 return constraint_ ==
null ? com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance() : constraint_;
676 return constraintBuilder_.getMessage();
686 public Builder
setConstraint(com.google.ortools.linearsolver.MPConstraintProto value) {
687 if (constraintBuilder_ ==
null) {
689 throw new NullPointerException();
693 constraintBuilder_.setMessage(value);
695 bitField0_ |= 0x00000004;
707 com.google.ortools.linearsolver.MPConstraintProto.Builder builderForValue) {
708 if (constraintBuilder_ ==
null) {
709 constraint_ = builderForValue.build();
711 constraintBuilder_.setMessage(builderForValue.build());
713 bitField0_ |= 0x00000004;
724 public Builder
mergeConstraint(com.google.ortools.linearsolver.MPConstraintProto value) {
725 if (constraintBuilder_ ==
null) {
726 if (((bitField0_ & 0x00000004) != 0) &&
727 constraint_ !=
null &&
728 constraint_ != com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance()) {
734 constraintBuilder_.mergeFrom(value);
736 if (constraint_ !=
null) {
737 bitField0_ |= 0x00000004;
750 bitField0_ = (bitField0_ & ~0x00000004);
752 if (constraintBuilder_ !=
null) {
753 constraintBuilder_.dispose();
754 constraintBuilder_ =
null;
767 bitField0_ |= 0x00000004;
769 return internalGetConstraintFieldBuilder().getBuilder();
779 if (constraintBuilder_ !=
null) {
780 return constraintBuilder_.getMessageOrBuilder();
782 return constraint_ ==
null ?
783 com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance() : constraint_;
793 private com.google.protobuf.SingleFieldBuilder<
794 com.google.ortools.linearsolver.MPConstraintProto, com.google.ortools.linearsolver.MPConstraintProto.Builder, com.google.ortools.linearsolver.MPConstraintProtoOrBuilder>
795 internalGetConstraintFieldBuilder() {
796 if (constraintBuilder_ ==
null) {
797 constraintBuilder_ =
new com.google.protobuf.SingleFieldBuilder<
798 com.google.ortools.linearsolver.MPConstraintProto, com.google.ortools.linearsolver.MPConstraintProto.Builder, com.google.ortools.linearsolver.MPConstraintProtoOrBuilder>(
800 getParentForChildren(),
804 return constraintBuilder_;
813 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPIndicatorConstraint();
817 return DEFAULT_INSTANCE;
824 com.google.protobuf.CodedInputStream input,
825 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
826 throws com.google.protobuf.InvalidProtocolBufferException {
829 builder.mergeFrom(input, extensionRegistry);
830 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
831 throw e.setUnfinishedMessage(builder.buildPartial());
832 }
catch (com.google.protobuf.UninitializedMessageException e) {
833 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
834 }
catch (java.io.IOException e) {
835 throw new com.google.protobuf.InvalidProtocolBufferException(e)
836 .setUnfinishedMessage(builder.buildPartial());
838 return builder.buildPartial();
842 public static com.google.protobuf.Parser<MPIndicatorConstraint>
parser() {
853 return DEFAULT_INSTANCE;