MPGeneralConstraintProto.java
Go to the documentation of this file.
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: ortools/linear_solver/linear_solver.proto
3 
4 package com.google.ortools.linearsolver;
5 
13 public final class MPGeneralConstraintProto extends
14  com.google.protobuf.GeneratedMessageV3 implements
15  // @@protoc_insertion_point(message_implements:operations_research.MPGeneralConstraintProto)
17 private static final long serialVersionUID = 0L;
18  // Use MPGeneralConstraintProto.newBuilder() to construct.
19  private MPGeneralConstraintProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
20  super(builder);
21  }
22  private MPGeneralConstraintProto() {
23  name_ = "";
24  }
25 
26  @java.lang.Override
27  @SuppressWarnings({"unused"})
28  protected java.lang.Object newInstance(
29  UnusedPrivateParameter unused) {
30  return new MPGeneralConstraintProto();
31  }
32 
33  @java.lang.Override
34  public final com.google.protobuf.UnknownFieldSet
36  return this.unknownFields;
37  }
39  com.google.protobuf.CodedInputStream input,
40  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
41  throws com.google.protobuf.InvalidProtocolBufferException {
42  this();
43  if (extensionRegistry == null) {
44  throw new java.lang.NullPointerException();
45  }
46  int mutable_bitField0_ = 0;
47  com.google.protobuf.UnknownFieldSet.Builder unknownFields =
48  com.google.protobuf.UnknownFieldSet.newBuilder();
49  try {
50  boolean done = false;
51  while (!done) {
52  int tag = input.readTag();
53  switch (tag) {
54  case 0:
55  done = true;
56  break;
57  case 10: {
58  com.google.protobuf.ByteString bs = input.readBytes();
59  bitField0_ |= 0x00000001;
60  name_ = bs;
61  break;
62  }
63  case 18: {
65  if (generalConstraintCase_ == 2) {
66  subBuilder = ((com.google.ortools.linearsolver.MPIndicatorConstraint) generalConstraint_).toBuilder();
67  }
68  generalConstraint_ =
69  input.readMessage(com.google.ortools.linearsolver.MPIndicatorConstraint.PARSER, extensionRegistry);
70  if (subBuilder != null) {
71  subBuilder.mergeFrom((com.google.ortools.linearsolver.MPIndicatorConstraint) generalConstraint_);
72  generalConstraint_ = subBuilder.buildPartial();
73  }
74  generalConstraintCase_ = 2;
75  break;
76  }
77  case 26: {
79  if (generalConstraintCase_ == 3) {
80  subBuilder = ((com.google.ortools.linearsolver.MPSosConstraint) generalConstraint_).toBuilder();
81  }
82  generalConstraint_ =
83  input.readMessage(com.google.ortools.linearsolver.MPSosConstraint.PARSER, extensionRegistry);
84  if (subBuilder != null) {
85  subBuilder.mergeFrom((com.google.ortools.linearsolver.MPSosConstraint) generalConstraint_);
86  generalConstraint_ = subBuilder.buildPartial();
87  }
88  generalConstraintCase_ = 3;
89  break;
90  }
91  default: {
92  if (!parseUnknownField(
93  input, unknownFields, extensionRegistry, tag)) {
94  done = true;
95  }
96  break;
97  }
98  }
99  }
100  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
101  throw e.setUnfinishedMessage(this);
102  } catch (java.io.IOException e) {
103  throw new com.google.protobuf.InvalidProtocolBufferException(
104  e).setUnfinishedMessage(this);
105  } finally {
106  this.unknownFields = unknownFields.build();
107  makeExtensionsImmutable();
108  }
109  }
110  public static final com.google.protobuf.Descriptors.Descriptor
112  return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPGeneralConstraintProto_descriptor;
113  }
114 
115  @java.lang.Override
116  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
118  return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPGeneralConstraintProto_fieldAccessorTable
119  .ensureFieldAccessorsInitialized(
121  }
122 
123  private int bitField0_;
124  private int generalConstraintCase_ = 0;
125  private java.lang.Object generalConstraint_;
127  implements com.google.protobuf.Internal.EnumLite {
131  private final int value;
132  private GeneralConstraintCase(int value) {
133  this.value = value;
134  }
138  @java.lang.Deprecated
139  public static GeneralConstraintCase valueOf(int value) {
140  return forNumber(value);
141  }
142 
143  public static GeneralConstraintCase forNumber(int value) {
144  switch (value) {
145  case 2: return INDICATOR_CONSTRAINT;
146  case 3: return SOS_CONSTRAINT;
147  case 0: return GENERALCONSTRAINT_NOT_SET;
148  default: return null;
149  }
150  }
151  public int getNumber() {
152  return this.value;
153  }
154  };
155 
156  public GeneralConstraintCase
159  generalConstraintCase_);
160  }
161 
162  public static final int NAME_FIELD_NUMBER = 1;
163  private volatile java.lang.Object name_;
171  public boolean hasName() {
172  return ((bitField0_ & 0x00000001) != 0);
173  }
181  public java.lang.String getName() {
182  java.lang.Object ref = name_;
183  if (ref instanceof java.lang.String) {
184  return (java.lang.String) ref;
185  } else {
186  com.google.protobuf.ByteString bs =
187  (com.google.protobuf.ByteString) ref;
188  java.lang.String s = bs.toStringUtf8();
189  if (bs.isValidUtf8()) {
190  name_ = s;
191  }
192  return s;
193  }
194  }
202  public com.google.protobuf.ByteString
204  java.lang.Object ref = name_;
205  if (ref instanceof java.lang.String) {
206  com.google.protobuf.ByteString b =
207  com.google.protobuf.ByteString.copyFromUtf8(
208  (java.lang.String) ref);
209  name_ = b;
210  return b;
211  } else {
212  return (com.google.protobuf.ByteString) ref;
213  }
214  }
215 
216  public static final int INDICATOR_CONSTRAINT_FIELD_NUMBER = 2;
220  public boolean hasIndicatorConstraint() {
221  return generalConstraintCase_ == 2;
222  }
227  if (generalConstraintCase_ == 2) {
228  return (com.google.ortools.linearsolver.MPIndicatorConstraint) generalConstraint_;
229  }
231  }
236  if (generalConstraintCase_ == 2) {
237  return (com.google.ortools.linearsolver.MPIndicatorConstraint) generalConstraint_;
238  }
240  }
241 
242  public static final int SOS_CONSTRAINT_FIELD_NUMBER = 3;
246  public boolean hasSosConstraint() {
247  return generalConstraintCase_ == 3;
248  }
253  if (generalConstraintCase_ == 3) {
254  return (com.google.ortools.linearsolver.MPSosConstraint) generalConstraint_;
255  }
257  }
262  if (generalConstraintCase_ == 3) {
263  return (com.google.ortools.linearsolver.MPSosConstraint) generalConstraint_;
264  }
266  }
267 
268  private byte memoizedIsInitialized = -1;
269  @java.lang.Override
270  public final boolean isInitialized() {
271  byte isInitialized = memoizedIsInitialized;
272  if (isInitialized == 1) return true;
273  if (isInitialized == 0) return false;
274 
275  memoizedIsInitialized = 1;
276  return true;
277  }
278 
279  @java.lang.Override
280  public void writeTo(com.google.protobuf.CodedOutputStream output)
281  throws java.io.IOException {
282  if (((bitField0_ & 0x00000001) != 0)) {
283  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
284  }
285  if (generalConstraintCase_ == 2) {
286  output.writeMessage(2, (com.google.ortools.linearsolver.MPIndicatorConstraint) generalConstraint_);
287  }
288  if (generalConstraintCase_ == 3) {
289  output.writeMessage(3, (com.google.ortools.linearsolver.MPSosConstraint) generalConstraint_);
290  }
291  unknownFields.writeTo(output);
292  }
293 
294  @java.lang.Override
295  public int getSerializedSize() {
296  int size = memoizedSize;
297  if (size != -1) return size;
298 
299  size = 0;
300  if (((bitField0_ & 0x00000001) != 0)) {
301  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
302  }
303  if (generalConstraintCase_ == 2) {
304  size += com.google.protobuf.CodedOutputStream
305  .computeMessageSize(2, (com.google.ortools.linearsolver.MPIndicatorConstraint) generalConstraint_);
306  }
307  if (generalConstraintCase_ == 3) {
308  size += com.google.protobuf.CodedOutputStream
309  .computeMessageSize(3, (com.google.ortools.linearsolver.MPSosConstraint) generalConstraint_);
310  }
311  size += unknownFields.getSerializedSize();
312  memoizedSize = size;
313  return size;
314  }
315 
316  @java.lang.Override
317  public boolean equals(final java.lang.Object obj) {
318  if (obj == this) {
319  return true;
320  }
321  if (!(obj instanceof com.google.ortools.linearsolver.MPGeneralConstraintProto)) {
322  return super.equals(obj);
323  }
325 
326  if (hasName() != other.hasName()) return false;
327  if (hasName()) {
328  if (!getName()
329  .equals(other.getName())) return false;
330  }
331  if (!getGeneralConstraintCase().equals(other.getGeneralConstraintCase())) return false;
332  switch (generalConstraintCase_) {
333  case 2:
335  .equals(other.getIndicatorConstraint())) return false;
336  break;
337  case 3:
338  if (!getSosConstraint()
339  .equals(other.getSosConstraint())) return false;
340  break;
341  case 0:
342  default:
343  }
344  if (!unknownFields.equals(other.unknownFields)) return false;
345  return true;
346  }
347 
348  @java.lang.Override
349  public int hashCode() {
350  if (memoizedHashCode != 0) {
351  return memoizedHashCode;
352  }
353  int hash = 41;
354  hash = (19 * hash) + getDescriptor().hashCode();
355  if (hasName()) {
356  hash = (37 * hash) + NAME_FIELD_NUMBER;
357  hash = (53 * hash) + getName().hashCode();
358  }
359  switch (generalConstraintCase_) {
360  case 2:
361  hash = (37 * hash) + INDICATOR_CONSTRAINT_FIELD_NUMBER;
362  hash = (53 * hash) + getIndicatorConstraint().hashCode();
363  break;
364  case 3:
365  hash = (37 * hash) + SOS_CONSTRAINT_FIELD_NUMBER;
366  hash = (53 * hash) + getSosConstraint().hashCode();
367  break;
368  case 0:
369  default:
370  }
371  hash = (29 * hash) + unknownFields.hashCode();
372  memoizedHashCode = hash;
373  return hash;
374  }
375 
377  java.nio.ByteBuffer data)
378  throws com.google.protobuf.InvalidProtocolBufferException {
379  return PARSER.parseFrom(data);
380  }
382  java.nio.ByteBuffer data,
383  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
384  throws com.google.protobuf.InvalidProtocolBufferException {
385  return PARSER.parseFrom(data, extensionRegistry);
386  }
388  com.google.protobuf.ByteString data)
389  throws com.google.protobuf.InvalidProtocolBufferException {
390  return PARSER.parseFrom(data);
391  }
393  com.google.protobuf.ByteString data,
394  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
395  throws com.google.protobuf.InvalidProtocolBufferException {
396  return PARSER.parseFrom(data, extensionRegistry);
397  }
399  throws com.google.protobuf.InvalidProtocolBufferException {
400  return PARSER.parseFrom(data);
401  }
403  byte[] data,
404  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
405  throws com.google.protobuf.InvalidProtocolBufferException {
406  return PARSER.parseFrom(data, extensionRegistry);
407  }
408  public static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(java.io.InputStream input)
409  throws java.io.IOException {
410  return com.google.protobuf.GeneratedMessageV3
411  .parseWithIOException(PARSER, input);
412  }
414  java.io.InputStream input,
415  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
416  throws java.io.IOException {
417  return com.google.protobuf.GeneratedMessageV3
418  .parseWithIOException(PARSER, input, extensionRegistry);
419  }
421  throws java.io.IOException {
422  return com.google.protobuf.GeneratedMessageV3
423  .parseDelimitedWithIOException(PARSER, input);
424  }
426  java.io.InputStream input,
427  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
428  throws java.io.IOException {
429  return com.google.protobuf.GeneratedMessageV3
430  .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
431  }
433  com.google.protobuf.CodedInputStream input)
434  throws java.io.IOException {
435  return com.google.protobuf.GeneratedMessageV3
436  .parseWithIOException(PARSER, input);
437  }
439  com.google.protobuf.CodedInputStream input,
440  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
441  throws java.io.IOException {
442  return com.google.protobuf.GeneratedMessageV3
443  .parseWithIOException(PARSER, input, extensionRegistry);
444  }
445 
446  @java.lang.Override
447  public Builder newBuilderForType() { return newBuilder(); }
448  public static Builder newBuilder() {
449  return DEFAULT_INSTANCE.toBuilder();
450  }
452  return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
453  }
454  @java.lang.Override
455  public Builder toBuilder() {
456  return this == DEFAULT_INSTANCE
457  ? new Builder() : new Builder().mergeFrom(this);
458  }
459 
460  @java.lang.Override
462  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
463  Builder builder = new Builder(parent);
464  return builder;
465  }
473  public static final class Builder extends
474  com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
475  // @@protoc_insertion_point(builder_implements:operations_research.MPGeneralConstraintProto)
476  com.google.ortools.linearsolver.MPGeneralConstraintProtoOrBuilder {
477  public static final com.google.protobuf.Descriptors.Descriptor
479  return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPGeneralConstraintProto_descriptor;
480  }
481 
482  @java.lang.Override
483  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
485  return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPGeneralConstraintProto_fieldAccessorTable
486  .ensureFieldAccessorsInitialized(
488  }
489 
490  // Construct using com.google.ortools.linearsolver.MPGeneralConstraintProto.newBuilder()
491  private Builder() {
492  maybeForceBuilderInitialization();
493  }
494 
495  private Builder(
496  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
497  super(parent);
498  maybeForceBuilderInitialization();
499  }
500  private void maybeForceBuilderInitialization() {
501  if (com.google.protobuf.GeneratedMessageV3
502  .alwaysUseFieldBuilders) {
503  }
504  }
505  @java.lang.Override
506  public Builder clear() {
507  super.clear();
508  name_ = "";
509  bitField0_ = (bitField0_ & ~0x00000001);
510  generalConstraintCase_ = 0;
511  generalConstraint_ = null;
512  return this;
513  }
514 
515  @java.lang.Override
516  public com.google.protobuf.Descriptors.Descriptor
518  return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPGeneralConstraintProto_descriptor;
519  }
520 
521  @java.lang.Override
524  }
525 
526  @java.lang.Override
529  if (!result.isInitialized()) {
530  throw newUninitializedMessageException(result);
531  }
532  return result;
533  }
534 
535  @java.lang.Override
538  int from_bitField0_ = bitField0_;
539  int to_bitField0_ = 0;
540  if (((from_bitField0_ & 0x00000001) != 0)) {
541  to_bitField0_ |= 0x00000001;
542  }
543  result.name_ = name_;
544  if (generalConstraintCase_ == 2) {
545  if (indicatorConstraintBuilder_ == null) {
546  result.generalConstraint_ = generalConstraint_;
547  } else {
548  result.generalConstraint_ = indicatorConstraintBuilder_.build();
549  }
550  }
551  if (generalConstraintCase_ == 3) {
552  if (sosConstraintBuilder_ == null) {
553  result.generalConstraint_ = generalConstraint_;
554  } else {
555  result.generalConstraint_ = sosConstraintBuilder_.build();
556  }
557  }
558  result.bitField0_ = to_bitField0_;
559  result.generalConstraintCase_ = generalConstraintCase_;
560  onBuilt();
561  return result;
562  }
563 
564  @java.lang.Override
565  public Builder clone() {
566  return super.clone();
567  }
568  @java.lang.Override
570  com.google.protobuf.Descriptors.FieldDescriptor field,
571  java.lang.Object value) {
572  return super.setField(field, value);
573  }
574  @java.lang.Override
576  com.google.protobuf.Descriptors.FieldDescriptor field) {
577  return super.clearField(field);
578  }
579  @java.lang.Override
581  com.google.protobuf.Descriptors.OneofDescriptor oneof) {
582  return super.clearOneof(oneof);
583  }
584  @java.lang.Override
586  com.google.protobuf.Descriptors.FieldDescriptor field,
587  int index, java.lang.Object value) {
588  return super.setRepeatedField(field, index, value);
589  }
590  @java.lang.Override
592  com.google.protobuf.Descriptors.FieldDescriptor field,
593  java.lang.Object value) {
594  return super.addRepeatedField(field, value);
595  }
596  @java.lang.Override
597  public Builder mergeFrom(com.google.protobuf.Message other) {
598  if (other instanceof com.google.ortools.linearsolver.MPGeneralConstraintProto) {
600  } else {
601  super.mergeFrom(other);
602  return this;
603  }
604  }
605 
608  if (other.hasName()) {
609  bitField0_ |= 0x00000001;
610  name_ = other.name_;
611  onChanged();
612  }
613  switch (other.getGeneralConstraintCase()) {
614  case INDICATOR_CONSTRAINT: {
615  mergeIndicatorConstraint(other.getIndicatorConstraint());
616  break;
617  }
618  case SOS_CONSTRAINT: {
619  mergeSosConstraint(other.getSosConstraint());
620  break;
621  }
622  case GENERALCONSTRAINT_NOT_SET: {
623  break;
624  }
625  }
626  this.mergeUnknownFields(other.unknownFields);
627  onChanged();
628  return this;
629  }
630 
631  @java.lang.Override
632  public final boolean isInitialized() {
633  return true;
634  }
635 
636  @java.lang.Override
638  com.google.protobuf.CodedInputStream input,
639  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
640  throws java.io.IOException {
642  try {
643  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
644  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
645  parsedMessage = (com.google.ortools.linearsolver.MPGeneralConstraintProto) e.getUnfinishedMessage();
646  throw e.unwrapIOException();
647  } finally {
648  if (parsedMessage != null) {
649  mergeFrom(parsedMessage);
650  }
651  }
652  return this;
653  }
654  private int generalConstraintCase_ = 0;
655  private java.lang.Object generalConstraint_;
656  public GeneralConstraintCase
659  generalConstraintCase_);
660  }
661 
663  generalConstraintCase_ = 0;
664  generalConstraint_ = null;
665  onChanged();
666  return this;
667  }
668 
669  private int bitField0_;
670 
671  private java.lang.Object name_ = "";
679  public boolean hasName() {
680  return ((bitField0_ & 0x00000001) != 0);
681  }
689  public java.lang.String getName() {
690  java.lang.Object ref = name_;
691  if (!(ref instanceof java.lang.String)) {
692  com.google.protobuf.ByteString bs =
693  (com.google.protobuf.ByteString) ref;
694  java.lang.String s = bs.toStringUtf8();
695  if (bs.isValidUtf8()) {
696  name_ = s;
697  }
698  return s;
699  } else {
700  return (java.lang.String) ref;
701  }
702  }
710  public com.google.protobuf.ByteString
712  java.lang.Object ref = name_;
713  if (ref instanceof String) {
714  com.google.protobuf.ByteString b =
715  com.google.protobuf.ByteString.copyFromUtf8(
716  (java.lang.String) ref);
717  name_ = b;
718  return b;
719  } else {
720  return (com.google.protobuf.ByteString) ref;
721  }
722  }
730  public Builder setName(
731  java.lang.String value) {
732  if (value == null) {
733  throw new NullPointerException();
734  }
735  bitField0_ |= 0x00000001;
736  name_ = value;
737  onChanged();
738  return this;
739  }
747  public Builder clearName() {
748  bitField0_ = (bitField0_ & ~0x00000001);
749  name_ = getDefaultInstance().getName();
750  onChanged();
751  return this;
752  }
761  com.google.protobuf.ByteString value) {
762  if (value == null) {
763  throw new NullPointerException();
764  }
765  bitField0_ |= 0x00000001;
766  name_ = value;
767  onChanged();
768  return this;
769  }
770 
771  private com.google.protobuf.SingleFieldBuilderV3<
776  public boolean hasIndicatorConstraint() {
777  return generalConstraintCase_ == 2;
778  }
783  if (indicatorConstraintBuilder_ == null) {
784  if (generalConstraintCase_ == 2) {
785  return (com.google.ortools.linearsolver.MPIndicatorConstraint) generalConstraint_;
786  }
788  } else {
789  if (generalConstraintCase_ == 2) {
790  return indicatorConstraintBuilder_.getMessage();
791  }
793  }
794  }
799  if (indicatorConstraintBuilder_ == null) {
800  if (value == null) {
801  throw new NullPointerException();
802  }
803  generalConstraint_ = value;
804  onChanged();
805  } else {
806  indicatorConstraintBuilder_.setMessage(value);
807  }
808  generalConstraintCase_ = 2;
809  return this;
810  }
816  if (indicatorConstraintBuilder_ == null) {
817  generalConstraint_ = builderForValue.build();
818  onChanged();
819  } else {
820  indicatorConstraintBuilder_.setMessage(builderForValue.build());
821  }
822  generalConstraintCase_ = 2;
823  return this;
824  }
829  if (indicatorConstraintBuilder_ == null) {
830  if (generalConstraintCase_ == 2 &&
833  .mergeFrom(value).buildPartial();
834  } else {
835  generalConstraint_ = value;
836  }
837  onChanged();
838  } else {
839  if (generalConstraintCase_ == 2) {
840  indicatorConstraintBuilder_.mergeFrom(value);
841  }
842  indicatorConstraintBuilder_.setMessage(value);
843  }
844  generalConstraintCase_ = 2;
845  return this;
846  }
851  if (indicatorConstraintBuilder_ == null) {
852  if (generalConstraintCase_ == 2) {
853  generalConstraintCase_ = 0;
854  generalConstraint_ = null;
855  onChanged();
856  }
857  } else {
858  if (generalConstraintCase_ == 2) {
859  generalConstraintCase_ = 0;
860  generalConstraint_ = null;
861  }
862  indicatorConstraintBuilder_.clear();
863  }
864  return this;
865  }
870  return getIndicatorConstraintFieldBuilder().getBuilder();
871  }
876  if ((generalConstraintCase_ == 2) && (indicatorConstraintBuilder_ != null)) {
877  return indicatorConstraintBuilder_.getMessageOrBuilder();
878  } else {
879  if (generalConstraintCase_ == 2) {
880  return (com.google.ortools.linearsolver.MPIndicatorConstraint) generalConstraint_;
881  }
883  }
884  }
888  private com.google.protobuf.SingleFieldBuilderV3<
890  getIndicatorConstraintFieldBuilder() {
891  if (indicatorConstraintBuilder_ == null) {
892  if (!(generalConstraintCase_ == 2)) {
894  }
895  indicatorConstraintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
897  (com.google.ortools.linearsolver.MPIndicatorConstraint) generalConstraint_,
898  getParentForChildren(),
899  isClean());
900  generalConstraint_ = null;
901  }
902  generalConstraintCase_ = 2;
903  onChanged();;
904  return indicatorConstraintBuilder_;
905  }
906 
907  private com.google.protobuf.SingleFieldBuilderV3<
912  public boolean hasSosConstraint() {
913  return generalConstraintCase_ == 3;
914  }
919  if (sosConstraintBuilder_ == null) {
920  if (generalConstraintCase_ == 3) {
921  return (com.google.ortools.linearsolver.MPSosConstraint) generalConstraint_;
922  }
924  } else {
925  if (generalConstraintCase_ == 3) {
926  return sosConstraintBuilder_.getMessage();
927  }
929  }
930  }
935  if (sosConstraintBuilder_ == null) {
936  if (value == null) {
937  throw new NullPointerException();
938  }
939  generalConstraint_ = value;
940  onChanged();
941  } else {
942  sosConstraintBuilder_.setMessage(value);
943  }
944  generalConstraintCase_ = 3;
945  return this;
946  }
952  if (sosConstraintBuilder_ == null) {
953  generalConstraint_ = builderForValue.build();
954  onChanged();
955  } else {
956  sosConstraintBuilder_.setMessage(builderForValue.build());
957  }
958  generalConstraintCase_ = 3;
959  return this;
960  }
965  if (sosConstraintBuilder_ == null) {
966  if (generalConstraintCase_ == 3 &&
969  .mergeFrom(value).buildPartial();
970  } else {
971  generalConstraint_ = value;
972  }
973  onChanged();
974  } else {
975  if (generalConstraintCase_ == 3) {
976  sosConstraintBuilder_.mergeFrom(value);
977  }
978  sosConstraintBuilder_.setMessage(value);
979  }
980  generalConstraintCase_ = 3;
981  return this;
982  }
987  if (sosConstraintBuilder_ == null) {
988  if (generalConstraintCase_ == 3) {
989  generalConstraintCase_ = 0;
990  generalConstraint_ = null;
991  onChanged();
992  }
993  } else {
994  if (generalConstraintCase_ == 3) {
995  generalConstraintCase_ = 0;
996  generalConstraint_ = null;
997  }
998  sosConstraintBuilder_.clear();
999  }
1000  return this;
1001  }
1006  return getSosConstraintFieldBuilder().getBuilder();
1007  }
1012  if ((generalConstraintCase_ == 3) && (sosConstraintBuilder_ != null)) {
1013  return sosConstraintBuilder_.getMessageOrBuilder();
1014  } else {
1015  if (generalConstraintCase_ == 3) {
1016  return (com.google.ortools.linearsolver.MPSosConstraint) generalConstraint_;
1017  }
1019  }
1020  }
1024  private com.google.protobuf.SingleFieldBuilderV3<
1026  getSosConstraintFieldBuilder() {
1027  if (sosConstraintBuilder_ == null) {
1028  if (!(generalConstraintCase_ == 3)) {
1030  }
1031  sosConstraintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
1033  (com.google.ortools.linearsolver.MPSosConstraint) generalConstraint_,
1034  getParentForChildren(),
1035  isClean());
1036  generalConstraint_ = null;
1037  }
1038  generalConstraintCase_ = 3;
1039  onChanged();;
1040  return sosConstraintBuilder_;
1041  }
1042  @java.lang.Override
1044  final com.google.protobuf.UnknownFieldSet unknownFields) {
1045  return super.setUnknownFields(unknownFields);
1046  }
1047 
1048  @java.lang.Override
1050  final com.google.protobuf.UnknownFieldSet unknownFields) {
1051  return super.mergeUnknownFields(unknownFields);
1052  }
1053 
1054 
1055  // @@protoc_insertion_point(builder_scope:operations_research.MPGeneralConstraintProto)
1056  }
1057 
1058  // @@protoc_insertion_point(class_scope:operations_research.MPGeneralConstraintProto)
1059  private static final com.google.ortools.linearsolver.MPGeneralConstraintProto DEFAULT_INSTANCE;
1060  static {
1061  DEFAULT_INSTANCE = new com.google.ortools.linearsolver.MPGeneralConstraintProto();
1062  }
1063 
1065  return DEFAULT_INSTANCE;
1066  }
1067 
1068  @java.lang.Deprecated public static final com.google.protobuf.Parser<MPGeneralConstraintProto>
1069  PARSER = new com.google.protobuf.AbstractParser<MPGeneralConstraintProto>() {
1070  @java.lang.Override
1071  public MPGeneralConstraintProto parsePartialFrom(
1072  com.google.protobuf.CodedInputStream input,
1073  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1074  throws com.google.protobuf.InvalidProtocolBufferException {
1075  return new MPGeneralConstraintProto(input, extensionRegistry);
1076  }
1077  };
1078 
1079  public static com.google.protobuf.Parser<MPGeneralConstraintProto> parser() {
1080  return PARSER;
1081  }
1082 
1083  @java.lang.Override
1085  return PARSER;
1086  }
1087 
1088  @java.lang.Override
1090  return DEFAULT_INSTANCE;
1091  }
1092 
1093 }
1094 
.lang.Override final com.google.protobuf.UnknownFieldSet getUnknownFields()
static com.google.ortools.linearsolver.MPSosConstraint getDefaultInstance()
.lang.Override com.google.protobuf.Parser< MPGeneralConstraintProto > getParserForType()
.lang.Override Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
com.google.ortools.linearsolver.MPSosConstraint getSosConstraint()
optional .operations_research.MPSosConstraint sos_constraint = 3;
.lang.Override final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(com.google.protobuf.CodedInputStream input)
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
.lang.Override com.google.ortools.linearsolver.MPIndicatorConstraint buildPartial()
.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
.lang.Override Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
boolean hasSosConstraint()
optional .operations_research.MPSosConstraint sos_constraint = 3;
.lang.Deprecated static final com.google.protobuf.Parser< MPIndicatorConstraint > PARSER
Builder setSosConstraint(com.google.ortools.linearsolver.MPSosConstraint.Builder builderForValue)
optional .operations_research.MPSosConstraint sos_constraint = 3;
.lang.Override Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
.lang.Override boolean equals(final java.lang.Object obj)
Builder clearSosConstraint()
optional .operations_research.MPSosConstraint sos_constraint = 3;
Builder setSosConstraint(com.google.ortools.linearsolver.MPSosConstraint value)
optional .operations_research.MPSosConstraint sos_constraint = 3;
Builder mergeIndicatorConstraint(com.google.ortools.linearsolver.MPIndicatorConstraint value)
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
boolean hasIndicatorConstraint()
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
.lang.Deprecated static final com.google.protobuf.Parser< MPGeneralConstraintProto > PARSER
.lang.Deprecated static final com.google.protobuf.Parser< MPSosConstraint > PARSER
.lang.Override com.google.ortools.linearsolver.MPSosConstraint buildPartial()
com.google.ortools.linearsolver.MPIndicatorConstraintOrBuilder getIndicatorConstraintOrBuilder()
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
com.google.ortools.linearsolver.MPSosConstraint.Builder getSosConstraintBuilder()
optional .operations_research.MPSosConstraint sos_constraint = 3;
com.google.ortools.linearsolver.MPIndicatorConstraint getIndicatorConstraint()
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override com.google.ortools.linearsolver.MPGeneralConstraintProto getDefaultInstanceForType()
.lang.Override com.google.ortools.linearsolver.MPGeneralConstraintProto build()
com.google.ortools.linearsolver.MPSosConstraintOrBuilder getSosConstraintOrBuilder()
optional .operations_research.MPSosConstraint sos_constraint = 3;
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
.lang.Override com.google.ortools.linearsolver.MPGeneralConstraintProto getDefaultInstanceForType()
.lang.Override final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
.lang.Override void writeTo(com.google.protobuf.CodedOutputStream output)
com.google.ortools.linearsolver.MPIndicatorConstraint.Builder getIndicatorConstraintBuilder()
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(java.io.InputStream input)
static com.google.ortools.linearsolver.MPGeneralConstraintProto getDefaultInstance()
Builder setIndicatorConstraint(com.google.ortools.linearsolver.MPIndicatorConstraint value)
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
com.google.ortools.linearsolver.MPSosConstraint getSosConstraint()
optional .operations_research.MPSosConstraint sos_constraint = 3;
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Builder mergeSosConstraint(com.google.ortools.linearsolver.MPSosConstraint value)
optional .operations_research.MPSosConstraint sos_constraint = 3;
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(byte[] data)
static Builder newBuilder(com.google.ortools.linearsolver.MPGeneralConstraintProto prototype)
.lang.Override Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
.lang.Override java.lang.Object newInstance(UnusedPrivateParameter unused)
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder clearIndicatorConstraint()
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
.lang.Override com.google.ortools.linearsolver.MPGeneralConstraintProto buildPartial()
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder setIndicatorConstraint(com.google.ortools.linearsolver.MPIndicatorConstraint.Builder builderForValue)
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
.lang.Override Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseDelimitedFrom(java.io.InputStream input)
static com.google.protobuf.Parser< MPGeneralConstraintProto > parser()
boolean hasSosConstraint()
optional .operations_research.MPSosConstraint sos_constraint = 3;
boolean hasIndicatorConstraint()
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
.lang.Override Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
com.google.ortools.linearsolver.MPIndicatorConstraint getIndicatorConstraint()
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
com.google.ortools.linearsolver.MPSosConstraintOrBuilder getSosConstraintOrBuilder()
optional .operations_research.MPSosConstraint sos_constraint = 3;
Builder mergeFrom(com.google.ortools.linearsolver.MPGeneralConstraintProto other)
.lang.Override boolean equals(final java.lang.Object obj)
.lang.Override Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
static com.google.ortools.linearsolver.MPIndicatorConstraint getDefaultInstance()
com.google.ortools.linearsolver.MPIndicatorConstraintOrBuilder getIndicatorConstraintOrBuilder()
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(java.nio.ByteBuffer data)
.lang.Override boolean equals(final java.lang.Object obj)
static com.google.ortools.linearsolver.MPGeneralConstraintProto parseFrom(com.google.protobuf.ByteString data)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()