6package com.google.ortools.linearsolver;
21public final class MPIndicatorConstraint
extends
22 com.google.protobuf.GeneratedMessage implements
25private static final long serialVersionUID = 0L;
27 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
28 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
33 MPIndicatorConstraint.class.getName());
36 private MPIndicatorConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
39 private MPIndicatorConstraint() {
42 public static final com.google.protobuf.Descriptors.Descriptor
44 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPIndicatorConstraint_descriptor;
48 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
50 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPIndicatorConstraint_fieldAccessorTable
51 .ensureFieldAccessorsInitialized(
52 com.google.ortools.linearsolver.MPIndicatorConstraint.class, com.google.ortools.linearsolver.MPIndicatorConstraint.Builder.class);
55 private int bitField0_;
57 private int varIndex_ = 0;
69 return ((bitField0_ & 0x00000001) != 0);
86 private int varValue_ = 0;
97 return ((bitField0_ & 0x00000002) != 0);
124 return ((bitField0_ & 0x00000004) != 0);
136 return constraint_ ==
null ? com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance() : constraint_;
147 return constraint_ ==
null ? com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance() : constraint_;
150 private byte memoizedIsInitialized = -1;
157 memoizedIsInitialized = 1;
162 public void writeTo(com.google.protobuf.CodedOutputStream output)
163 throws java.io.IOException {
164 if (((bitField0_ & 0x00000001) != 0)) {
165 output.writeInt32(1, varIndex_);
167 if (((bitField0_ & 0x00000002) != 0)) {
168 output.writeInt32(2, varValue_);
170 if (((bitField0_ & 0x00000004) != 0)) {
173 getUnknownFields().writeTo(output);
178 int size = memoizedSize;
179 if (size != -1)
return size;
182 if (((bitField0_ & 0x00000001) != 0)) {
183 size += com.google.protobuf.CodedOutputStream
184 .computeInt32Size(1, varIndex_);
186 if (((bitField0_ & 0x00000002) != 0)) {
187 size += com.google.protobuf.CodedOutputStream
188 .computeInt32Size(2, varValue_);
190 if (((bitField0_ & 0x00000004) != 0)) {
191 size += com.google.protobuf.CodedOutputStream
194 size += getUnknownFields().getSerializedSize();
200 public boolean equals(
final java.lang.Object obj) {
204 if (!(obj instanceof com.google.ortools.linearsolver.MPIndicatorConstraint)) {
205 return super.equals(obj);
224 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
230 if (memoizedHashCode != 0) {
231 return memoizedHashCode;
247 hash = (29 * hash) + getUnknownFields().hashCode();
248 memoizedHashCode = hash;
253 java.nio.ByteBuffer data)
254 throws com.google.protobuf.InvalidProtocolBufferException {
255 return PARSER.parseFrom(data);
258 java.nio.ByteBuffer data,
259 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
260 throws com.google.protobuf.InvalidProtocolBufferException {
261 return PARSER.parseFrom(data, extensionRegistry);
264 com.google.protobuf.ByteString data)
265 throws com.google.protobuf.InvalidProtocolBufferException {
266 return PARSER.parseFrom(data);
269 com.google.protobuf.ByteString data,
270 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
271 throws com.google.protobuf.InvalidProtocolBufferException {
272 return PARSER.parseFrom(data, extensionRegistry);
275 throws com.google.protobuf.InvalidProtocolBufferException {
276 return PARSER.parseFrom(data);
280 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
281 throws com.google.protobuf.InvalidProtocolBufferException {
282 return PARSER.parseFrom(data, extensionRegistry);
285 throws java.io.IOException {
286 return com.google.protobuf.GeneratedMessage
287 .parseWithIOException(PARSER, input);
290 java.io.InputStream input,
291 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
292 throws java.io.IOException {
293 return com.google.protobuf.GeneratedMessage
294 .parseWithIOException(PARSER, input, extensionRegistry);
298 throws java.io.IOException {
299 return com.google.protobuf.GeneratedMessage
300 .parseDelimitedWithIOException(PARSER, input);
304 java.io.InputStream input,
305 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
306 throws java.io.IOException {
307 return com.google.protobuf.GeneratedMessage
308 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
311 com.google.protobuf.CodedInputStream input)
312 throws java.io.IOException {
313 return com.google.protobuf.GeneratedMessage
314 .parseWithIOException(PARSER, input);
317 com.google.protobuf.CodedInputStream input,
318 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
319 throws java.io.IOException {
320 return com.google.protobuf.GeneratedMessage
321 .parseWithIOException(PARSER, input, extensionRegistry);
327 return DEFAULT_INSTANCE.toBuilder();
329 public static Builder newBuilder(com.google.ortools.linearsolver.MPIndicatorConstraint prototype) {
330 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
334 return this == DEFAULT_INSTANCE
340 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
357 public static final class Builder
extends
358 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
361 public static final com.google.protobuf.Descriptors.Descriptor
363 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPIndicatorConstraint_descriptor;
367 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
369 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPIndicatorConstraint_fieldAccessorTable
370 .ensureFieldAccessorsInitialized(
371 com.google.ortools.linearsolver.MPIndicatorConstraint.class, com.google.ortools.linearsolver.MPIndicatorConstraint.Builder.class);
376 maybeForceBuilderInitialization();
380 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
382 maybeForceBuilderInitialization();
384 private void maybeForceBuilderInitialization() {
385 if (com.google.protobuf.GeneratedMessage
386 .alwaysUseFieldBuilders) {
387 getConstraintFieldBuilder();
397 if (constraintBuilder_ !=
null) {
398 constraintBuilder_.dispose();
399 constraintBuilder_ =
null;
405 public com.google.protobuf.Descriptors.Descriptor
407 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPIndicatorConstraint_descriptor;
412 return com.google.ortools.linearsolver.MPIndicatorConstraint.getDefaultInstance();
419 throw newUninitializedMessageException(result);
427 if (bitField0_ != 0) { buildPartial0(result); }
432 private void buildPartial0(com.google.ortools.linearsolver.MPIndicatorConstraint result) {
433 int from_bitField0_ = bitField0_;
434 int to_bitField0_ = 0;
435 if (((from_bitField0_ & 0x00000001) != 0)) {
436 result.varIndex_ = varIndex_;
437 to_bitField0_ |= 0x00000001;
439 if (((from_bitField0_ & 0x00000002) != 0)) {
440 result.varValue_ = varValue_;
441 to_bitField0_ |= 0x00000002;
443 if (((from_bitField0_ & 0x00000004) != 0)) {
444 result.constraint_ = constraintBuilder_ ==
null
446 : constraintBuilder_.build();
447 to_bitField0_ |= 0x00000004;
449 result.bitField0_ |= to_bitField0_;
453 public Builder
mergeFrom(com.google.protobuf.Message other) {
454 if (other instanceof com.google.ortools.linearsolver.MPIndicatorConstraint) {
455 return mergeFrom((com.google.ortools.linearsolver.MPIndicatorConstraint)other);
457 super.mergeFrom(other);
462 public Builder
mergeFrom(com.google.ortools.linearsolver.MPIndicatorConstraint other) {
463 if (other == com.google.ortools.linearsolver.MPIndicatorConstraint.getDefaultInstance())
return this;
464 if (other.hasVarIndex()) {
467 if (other.hasVarValue()) {
470 if (other.hasConstraint()) {
473 this.mergeUnknownFields(other.getUnknownFields());
485 com.google.protobuf.CodedInputStream input,
486 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
487 throws java.io.IOException {
488 if (extensionRegistry ==
null) {
489 throw new java.lang.NullPointerException();
492 boolean done =
false;
494 int tag = input.readTag();
500 varIndex_ = input.readInt32();
501 bitField0_ |= 0x00000001;
505 varValue_ = input.readInt32();
506 bitField0_ |= 0x00000002;
511 getConstraintFieldBuilder().getBuilder(),
513 bitField0_ |= 0x00000004;
517 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
524 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
525 throw e.unwrapIOException();
531 private int bitField0_;
533 private int varIndex_ ;
545 return ((bitField0_ & 0x00000001) != 0);
573 bitField0_ |= 0x00000001;
587 bitField0_ = (bitField0_ & ~0x00000001);
593 private int varValue_ ;
604 return ((bitField0_ & 0x00000002) != 0);
630 bitField0_ |= 0x00000002;
643 bitField0_ = (bitField0_ & ~0x00000002);
650 private com.google.protobuf.SingleFieldBuilder<
651 com.google.ortools.linearsolver.MPConstraintProto, com.google.ortools.linearsolver.MPConstraintProto.Builder, com.google.ortools.linearsolver.MPConstraintProtoOrBuilder> constraintBuilder_;
661 return ((bitField0_ & 0x00000004) != 0);
672 if (constraintBuilder_ ==
null) {
673 return constraint_ ==
null ? com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance() : constraint_;
675 return constraintBuilder_.getMessage();
685 public Builder
setConstraint(com.google.ortools.linearsolver.MPConstraintProto value) {
686 if (constraintBuilder_ ==
null) {
688 throw new NullPointerException();
692 constraintBuilder_.setMessage(value);
694 bitField0_ |= 0x00000004;
706 com.google.ortools.linearsolver.MPConstraintProto.Builder builderForValue) {
707 if (constraintBuilder_ ==
null) {
708 constraint_ = builderForValue.build();
710 constraintBuilder_.setMessage(builderForValue.build());
712 bitField0_ |= 0x00000004;
723 public Builder
mergeConstraint(com.google.ortools.linearsolver.MPConstraintProto value) {
724 if (constraintBuilder_ ==
null) {
725 if (((bitField0_ & 0x00000004) != 0) &&
726 constraint_ !=
null &&
727 constraint_ != com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance()) {
733 constraintBuilder_.mergeFrom(value);
735 if (constraint_ !=
null) {
736 bitField0_ |= 0x00000004;
749 bitField0_ = (bitField0_ & ~0x00000004);
751 if (constraintBuilder_ !=
null) {
752 constraintBuilder_.dispose();
753 constraintBuilder_ =
null;
766 bitField0_ |= 0x00000004;
768 return getConstraintFieldBuilder().getBuilder();
778 if (constraintBuilder_ !=
null) {
779 return constraintBuilder_.getMessageOrBuilder();
781 return constraint_ ==
null ?
782 com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance() : constraint_;
792 private com.google.protobuf.SingleFieldBuilder<
793 com.google.ortools.linearsolver.MPConstraintProto, com.google.ortools.linearsolver.MPConstraintProto.Builder, com.google.ortools.linearsolver.MPConstraintProtoOrBuilder>
794 getConstraintFieldBuilder() {
795 if (constraintBuilder_ ==
null) {
796 constraintBuilder_ =
new com.google.protobuf.SingleFieldBuilder<
797 com.google.ortools.linearsolver.MPConstraintProto, com.google.ortools.linearsolver.MPConstraintProto.Builder, com.google.ortools.linearsolver.MPConstraintProtoOrBuilder>(
799 getParentForChildren(),
803 return constraintBuilder_;
812 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPIndicatorConstraint();
816 return DEFAULT_INSTANCE;
823 com.google.protobuf.CodedInputStream input,
824 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
825 throws com.google.protobuf.InvalidProtocolBufferException {
828 builder.mergeFrom(input, extensionRegistry);
829 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
830 throw e.setUnfinishedMessage(builder.buildPartial());
831 }
catch (com.google.protobuf.UninitializedMessageException e) {
832 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
833 }
catch (java.io.IOException e) {
834 throw new com.google.protobuf.InvalidProtocolBufferException(e)
835 .setUnfinishedMessage(builder.buildPartial());
837 return builder.buildPartial();
841 public static com.google.protobuf.Parser<MPIndicatorConstraint>
parser() {
852 return DEFAULT_INSTANCE;