Java Reference

Java Reference

ReservoirConstraintProto.java
Go to the documentation of this file.
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: ortools/sat/cp_model.proto
3 
4 package com.google.ortools.sat;
5 
23 public final class ReservoirConstraintProto extends
24  com.google.protobuf.GeneratedMessageV3 implements
25  // @@protoc_insertion_point(message_implements:operations_research.sat.ReservoirConstraintProto)
27 private static final long serialVersionUID = 0L;
28  // Use ReservoirConstraintProto.newBuilder() to construct.
29  private ReservoirConstraintProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
30  super(builder);
31  }
32  private ReservoirConstraintProto() {
33  times_ = emptyIntList();
34  demands_ = emptyLongList();
35  actives_ = emptyIntList();
36  }
37 
38  @java.lang.Override
39  @SuppressWarnings({"unused"})
40  protected java.lang.Object newInstance(
41  UnusedPrivateParameter unused) {
42  return new ReservoirConstraintProto();
43  }
44 
45  @java.lang.Override
46  public final com.google.protobuf.UnknownFieldSet
48  return this.unknownFields;
49  }
51  com.google.protobuf.CodedInputStream input,
52  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
53  throws com.google.protobuf.InvalidProtocolBufferException {
54  this();
55  if (extensionRegistry == null) {
56  throw new java.lang.NullPointerException();
57  }
58  int mutable_bitField0_ = 0;
59  com.google.protobuf.UnknownFieldSet.Builder unknownFields =
60  com.google.protobuf.UnknownFieldSet.newBuilder();
61  try {
62  boolean done = false;
63  while (!done) {
64  int tag = input.readTag();
65  switch (tag) {
66  case 0:
67  done = true;
68  break;
69  case 8: {
70 
71  minLevel_ = input.readInt64();
72  break;
73  }
74  case 16: {
75 
76  maxLevel_ = input.readInt64();
77  break;
78  }
79  case 24: {
80  if (!((mutable_bitField0_ & 0x00000001) != 0)) {
81  times_ = newIntList();
82  mutable_bitField0_ |= 0x00000001;
83  }
84  times_.addInt(input.readInt32());
85  break;
86  }
87  case 26: {
88  int length = input.readRawVarint32();
89  int limit = input.pushLimit(length);
90  if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) {
91  times_ = newIntList();
92  mutable_bitField0_ |= 0x00000001;
93  }
94  while (input.getBytesUntilLimit() > 0) {
95  times_.addInt(input.readInt32());
96  }
97  input.popLimit(limit);
98  break;
99  }
100  case 32: {
101  if (!((mutable_bitField0_ & 0x00000002) != 0)) {
102  demands_ = newLongList();
103  mutable_bitField0_ |= 0x00000002;
104  }
105  demands_.addLong(input.readInt64());
106  break;
107  }
108  case 34: {
109  int length = input.readRawVarint32();
110  int limit = input.pushLimit(length);
111  if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) {
112  demands_ = newLongList();
113  mutable_bitField0_ |= 0x00000002;
114  }
115  while (input.getBytesUntilLimit() > 0) {
116  demands_.addLong(input.readInt64());
117  }
118  input.popLimit(limit);
119  break;
120  }
121  case 40: {
122  if (!((mutable_bitField0_ & 0x00000004) != 0)) {
123  actives_ = newIntList();
124  mutable_bitField0_ |= 0x00000004;
125  }
126  actives_.addInt(input.readInt32());
127  break;
128  }
129  case 42: {
130  int length = input.readRawVarint32();
131  int limit = input.pushLimit(length);
132  if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) {
133  actives_ = newIntList();
134  mutable_bitField0_ |= 0x00000004;
135  }
136  while (input.getBytesUntilLimit() > 0) {
137  actives_.addInt(input.readInt32());
138  }
139  input.popLimit(limit);
140  break;
141  }
142  default: {
143  if (!parseUnknownField(
144  input, unknownFields, extensionRegistry, tag)) {
145  done = true;
146  }
147  break;
148  }
149  }
150  }
151  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
152  throw e.setUnfinishedMessage(this);
153  } catch (java.io.IOException e) {
154  throw new com.google.protobuf.InvalidProtocolBufferException(
155  e).setUnfinishedMessage(this);
156  } finally {
157  if (((mutable_bitField0_ & 0x00000001) != 0)) {
158  times_.makeImmutable(); // C
159  }
160  if (((mutable_bitField0_ & 0x00000002) != 0)) {
161  demands_.makeImmutable(); // C
162  }
163  if (((mutable_bitField0_ & 0x00000004) != 0)) {
164  actives_.makeImmutable(); // C
165  }
166  this.unknownFields = unknownFields.build();
167  makeExtensionsImmutable();
168  }
169  }
170  public static final com.google.protobuf.Descriptors.Descriptor
172  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ReservoirConstraintProto_descriptor;
173  }
174 
175  @java.lang.Override
176  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
178  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ReservoirConstraintProto_fieldAccessorTable
179  .ensureFieldAccessorsInitialized(
180  com.google.ortools.sat.ReservoirConstraintProto.class, com.google.ortools.sat.ReservoirConstraintProto.Builder.class);
181  }
182 
183  public static final int MIN_LEVEL_FIELD_NUMBER = 1;
184  private long minLevel_;
189  @java.lang.Override
190  public long getMinLevel() {
191  return minLevel_;
192  }
193 
194  public static final int MAX_LEVEL_FIELD_NUMBER = 2;
195  private long maxLevel_;
200  @java.lang.Override
201  public long getMaxLevel() {
202  return maxLevel_;
203  }
204 
205  public static final int TIMES_FIELD_NUMBER = 3;
206  private com.google.protobuf.Internal.IntList times_;
215  @java.lang.Override
216  public java.util.List<java.lang.Integer>
218  return times_;
219  }
228  public int getTimesCount() {
229  return times_.size();
230  }
240  public int getTimes(int index) {
241  return times_.getInt(index);
242  }
243  private int timesMemoizedSerializedSize = -1;
244 
245  public static final int DEMANDS_FIELD_NUMBER = 4;
246  private com.google.protobuf.Internal.LongList demands_;
255  @java.lang.Override
256  public java.util.List<java.lang.Long>
258  return demands_;
259  }
268  public int getDemandsCount() {
269  return demands_.size();
270  }
280  public long getDemands(int index) {
281  return demands_.getLong(index);
282  }
283  private int demandsMemoizedSerializedSize = -1;
284 
285  public static final int ACTIVES_FIELD_NUMBER = 5;
286  private com.google.protobuf.Internal.IntList actives_;
295  @java.lang.Override
296  public java.util.List<java.lang.Integer>
298  return actives_;
299  }
308  public int getActivesCount() {
309  return actives_.size();
310  }
320  public int getActives(int index) {
321  return actives_.getInt(index);
322  }
323  private int activesMemoizedSerializedSize = -1;
324 
325  private byte memoizedIsInitialized = -1;
326  @java.lang.Override
327  public final boolean isInitialized() {
328  byte isInitialized = memoizedIsInitialized;
329  if (isInitialized == 1) return true;
330  if (isInitialized == 0) return false;
331 
332  memoizedIsInitialized = 1;
333  return true;
334  }
335 
336  @java.lang.Override
337  public void writeTo(com.google.protobuf.CodedOutputStream output)
338  throws java.io.IOException {
340  if (minLevel_ != 0L) {
341  output.writeInt64(1, minLevel_);
342  }
343  if (maxLevel_ != 0L) {
344  output.writeInt64(2, maxLevel_);
345  }
346  if (getTimesList().size() > 0) {
347  output.writeUInt32NoTag(26);
348  output.writeUInt32NoTag(timesMemoizedSerializedSize);
349  }
350  for (int i = 0; i < times_.size(); i++) {
351  output.writeInt32NoTag(times_.getInt(i));
352  }
353  if (getDemandsList().size() > 0) {
354  output.writeUInt32NoTag(34);
355  output.writeUInt32NoTag(demandsMemoizedSerializedSize);
356  }
357  for (int i = 0; i < demands_.size(); i++) {
358  output.writeInt64NoTag(demands_.getLong(i));
359  }
360  if (getActivesList().size() > 0) {
361  output.writeUInt32NoTag(42);
362  output.writeUInt32NoTag(activesMemoizedSerializedSize);
363  }
364  for (int i = 0; i < actives_.size(); i++) {
365  output.writeInt32NoTag(actives_.getInt(i));
366  }
367  unknownFields.writeTo(output);
368  }
369 
370  @java.lang.Override
371  public int getSerializedSize() {
372  int size = memoizedSize;
373  if (size != -1) return size;
374 
375  size = 0;
376  if (minLevel_ != 0L) {
377  size += com.google.protobuf.CodedOutputStream
378  .computeInt64Size(1, minLevel_);
379  }
380  if (maxLevel_ != 0L) {
381  size += com.google.protobuf.CodedOutputStream
382  .computeInt64Size(2, maxLevel_);
383  }
384  {
385  int dataSize = 0;
386  for (int i = 0; i < times_.size(); i++) {
387  dataSize += com.google.protobuf.CodedOutputStream
388  .computeInt32SizeNoTag(times_.getInt(i));
389  }
390  size += dataSize;
391  if (!getTimesList().isEmpty()) {
392  size += 1;
393  size += com.google.protobuf.CodedOutputStream
394  .computeInt32SizeNoTag(dataSize);
395  }
396  timesMemoizedSerializedSize = dataSize;
397  }
398  {
399  int dataSize = 0;
400  for (int i = 0; i < demands_.size(); i++) {
401  dataSize += com.google.protobuf.CodedOutputStream
402  .computeInt64SizeNoTag(demands_.getLong(i));
403  }
404  size += dataSize;
405  if (!getDemandsList().isEmpty()) {
406  size += 1;
407  size += com.google.protobuf.CodedOutputStream
408  .computeInt32SizeNoTag(dataSize);
409  }
410  demandsMemoizedSerializedSize = dataSize;
411  }
412  {
413  int dataSize = 0;
414  for (int i = 0; i < actives_.size(); i++) {
415  dataSize += com.google.protobuf.CodedOutputStream
416  .computeInt32SizeNoTag(actives_.getInt(i));
417  }
418  size += dataSize;
419  if (!getActivesList().isEmpty()) {
420  size += 1;
421  size += com.google.protobuf.CodedOutputStream
422  .computeInt32SizeNoTag(dataSize);
423  }
424  activesMemoizedSerializedSize = dataSize;
425  }
426  size += unknownFields.getSerializedSize();
427  memoizedSize = size;
428  return size;
429  }
430 
431  @java.lang.Override
432  public boolean equals(final java.lang.Object obj) {
433  if (obj == this) {
434  return true;
435  }
436  if (!(obj instanceof com.google.ortools.sat.ReservoirConstraintProto)) {
437  return super.equals(obj);
438  }
439  com.google.ortools.sat.ReservoirConstraintProto other = (com.google.ortools.sat.ReservoirConstraintProto) obj;
440 
441  if (getMinLevel()
442  != other.getMinLevel()) return false;
443  if (getMaxLevel()
444  != other.getMaxLevel()) return false;
445  if (!getTimesList()
446  .equals(other.getTimesList())) return false;
447  if (!getDemandsList()
448  .equals(other.getDemandsList())) return false;
449  if (!getActivesList()
450  .equals(other.getActivesList())) return false;
451  if (!unknownFields.equals(other.unknownFields)) return false;
452  return true;
453  }
454 
455  @java.lang.Override
456  public int hashCode() {
457  if (memoizedHashCode != 0) {
458  return memoizedHashCode;
459  }
460  int hash = 41;
461  hash = (19 * hash) + getDescriptor().hashCode();
462  hash = (37 * hash) + MIN_LEVEL_FIELD_NUMBER;
463  hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
464  getMinLevel());
465  hash = (37 * hash) + MAX_LEVEL_FIELD_NUMBER;
466  hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
467  getMaxLevel());
468  if (getTimesCount() > 0) {
469  hash = (37 * hash) + TIMES_FIELD_NUMBER;
470  hash = (53 * hash) + getTimesList().hashCode();
471  }
472  if (getDemandsCount() > 0) {
473  hash = (37 * hash) + DEMANDS_FIELD_NUMBER;
474  hash = (53 * hash) + getDemandsList().hashCode();
475  }
476  if (getActivesCount() > 0) {
477  hash = (37 * hash) + ACTIVES_FIELD_NUMBER;
478  hash = (53 * hash) + getActivesList().hashCode();
479  }
480  hash = (29 * hash) + unknownFields.hashCode();
481  memoizedHashCode = hash;
482  return hash;
483  }
484 
485  public static com.google.ortools.sat.ReservoirConstraintProto parseFrom(
486  java.nio.ByteBuffer data)
487  throws com.google.protobuf.InvalidProtocolBufferException {
488  return PARSER.parseFrom(data);
489  }
490  public static com.google.ortools.sat.ReservoirConstraintProto parseFrom(
491  java.nio.ByteBuffer data,
492  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
493  throws com.google.protobuf.InvalidProtocolBufferException {
494  return PARSER.parseFrom(data, extensionRegistry);
495  }
496  public static com.google.ortools.sat.ReservoirConstraintProto parseFrom(
497  com.google.protobuf.ByteString data)
498  throws com.google.protobuf.InvalidProtocolBufferException {
499  return PARSER.parseFrom(data);
500  }
501  public static com.google.ortools.sat.ReservoirConstraintProto parseFrom(
502  com.google.protobuf.ByteString data,
503  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
504  throws com.google.protobuf.InvalidProtocolBufferException {
505  return PARSER.parseFrom(data, extensionRegistry);
506  }
507  public static com.google.ortools.sat.ReservoirConstraintProto parseFrom(byte[] data)
508  throws com.google.protobuf.InvalidProtocolBufferException {
509  return PARSER.parseFrom(data);
510  }
511  public static com.google.ortools.sat.ReservoirConstraintProto parseFrom(
512  byte[] data,
513  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
514  throws com.google.protobuf.InvalidProtocolBufferException {
515  return PARSER.parseFrom(data, extensionRegistry);
516  }
517  public static com.google.ortools.sat.ReservoirConstraintProto parseFrom(java.io.InputStream input)
518  throws java.io.IOException {
519  return com.google.protobuf.GeneratedMessageV3
520  .parseWithIOException(PARSER, input);
521  }
522  public static com.google.ortools.sat.ReservoirConstraintProto parseFrom(
523  java.io.InputStream input,
524  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
525  throws java.io.IOException {
526  return com.google.protobuf.GeneratedMessageV3
527  .parseWithIOException(PARSER, input, extensionRegistry);
528  }
529  public static com.google.ortools.sat.ReservoirConstraintProto parseDelimitedFrom(java.io.InputStream input)
530  throws java.io.IOException {
531  return com.google.protobuf.GeneratedMessageV3
532  .parseDelimitedWithIOException(PARSER, input);
533  }
534  public static com.google.ortools.sat.ReservoirConstraintProto parseDelimitedFrom(
535  java.io.InputStream input,
536  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
537  throws java.io.IOException {
538  return com.google.protobuf.GeneratedMessageV3
539  .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
540  }
541  public static com.google.ortools.sat.ReservoirConstraintProto parseFrom(
542  com.google.protobuf.CodedInputStream input)
543  throws java.io.IOException {
544  return com.google.protobuf.GeneratedMessageV3
545  .parseWithIOException(PARSER, input);
546  }
547  public static com.google.ortools.sat.ReservoirConstraintProto parseFrom(
548  com.google.protobuf.CodedInputStream input,
549  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
550  throws java.io.IOException {
551  return com.google.protobuf.GeneratedMessageV3
552  .parseWithIOException(PARSER, input, extensionRegistry);
553  }
554 
555  @java.lang.Override
556  public Builder newBuilderForType() { return newBuilder(); }
557  public static Builder newBuilder() {
558  return DEFAULT_INSTANCE.toBuilder();
559  }
560  public static Builder newBuilder(com.google.ortools.sat.ReservoirConstraintProto prototype) {
561  return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
562  }
563  @java.lang.Override
564  public Builder toBuilder() {
565  return this == DEFAULT_INSTANCE
566  ? new Builder() : new Builder().mergeFrom(this);
567  }
568 
569  @java.lang.Override
571  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
572  Builder builder = new Builder(parent);
573  return builder;
574  }
592  public static final class Builder extends
593  com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
594  // @@protoc_insertion_point(builder_implements:operations_research.sat.ReservoirConstraintProto)
595  com.google.ortools.sat.ReservoirConstraintProtoOrBuilder {
596  public static final com.google.protobuf.Descriptors.Descriptor
598  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ReservoirConstraintProto_descriptor;
599  }
600 
601  @java.lang.Override
602  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
604  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ReservoirConstraintProto_fieldAccessorTable
605  .ensureFieldAccessorsInitialized(
606  com.google.ortools.sat.ReservoirConstraintProto.class, com.google.ortools.sat.ReservoirConstraintProto.Builder.class);
607  }
608 
609  // Construct using com.google.ortools.sat.ReservoirConstraintProto.newBuilder()
610  private Builder() {
611  maybeForceBuilderInitialization();
612  }
613 
614  private Builder(
615  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
616  super(parent);
617  maybeForceBuilderInitialization();
618  }
619  private void maybeForceBuilderInitialization() {
620  if (com.google.protobuf.GeneratedMessageV3
621  .alwaysUseFieldBuilders) {
622  }
623  }
624  @java.lang.Override
625  public Builder clear() {
626  super.clear();
627  minLevel_ = 0L;
628 
629  maxLevel_ = 0L;
630 
631  times_ = emptyIntList();
632  bitField0_ = (bitField0_ & ~0x00000001);
633  demands_ = emptyLongList();
634  bitField0_ = (bitField0_ & ~0x00000002);
635  actives_ = emptyIntList();
636  bitField0_ = (bitField0_ & ~0x00000004);
637  return this;
638  }
639 
640  @java.lang.Override
641  public com.google.protobuf.Descriptors.Descriptor
643  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ReservoirConstraintProto_descriptor;
644  }
645 
646  @java.lang.Override
647  public com.google.ortools.sat.ReservoirConstraintProto getDefaultInstanceForType() {
648  return com.google.ortools.sat.ReservoirConstraintProto.getDefaultInstance();
649  }
650 
651  @java.lang.Override
652  public com.google.ortools.sat.ReservoirConstraintProto build() {
653  com.google.ortools.sat.ReservoirConstraintProto result = buildPartial();
654  if (!result.isInitialized()) {
655  throw newUninitializedMessageException(result);
656  }
657  return result;
658  }
659 
660  @java.lang.Override
661  public com.google.ortools.sat.ReservoirConstraintProto buildPartial() {
662  com.google.ortools.sat.ReservoirConstraintProto result = new com.google.ortools.sat.ReservoirConstraintProto(this);
663  int from_bitField0_ = bitField0_;
664  result.minLevel_ = minLevel_;
665  result.maxLevel_ = maxLevel_;
666  if (((bitField0_ & 0x00000001) != 0)) {
667  times_.makeImmutable();
668  bitField0_ = (bitField0_ & ~0x00000001);
669  }
670  result.times_ = times_;
671  if (((bitField0_ & 0x00000002) != 0)) {
672  demands_.makeImmutable();
673  bitField0_ = (bitField0_ & ~0x00000002);
674  }
675  result.demands_ = demands_;
676  if (((bitField0_ & 0x00000004) != 0)) {
677  actives_.makeImmutable();
678  bitField0_ = (bitField0_ & ~0x00000004);
679  }
680  result.actives_ = actives_;
681  onBuilt();
682  return result;
683  }
684 
685  @java.lang.Override
686  public Builder clone() {
687  return super.clone();
688  }
689  @java.lang.Override
691  com.google.protobuf.Descriptors.FieldDescriptor field,
692  java.lang.Object value) {
693  return super.setField(field, value);
694  }
695  @java.lang.Override
697  com.google.protobuf.Descriptors.FieldDescriptor field) {
698  return super.clearField(field);
699  }
700  @java.lang.Override
702  com.google.protobuf.Descriptors.OneofDescriptor oneof) {
703  return super.clearOneof(oneof);
704  }
705  @java.lang.Override
707  com.google.protobuf.Descriptors.FieldDescriptor field,
708  int index, java.lang.Object value) {
709  return super.setRepeatedField(field, index, value);
710  }
711  @java.lang.Override
713  com.google.protobuf.Descriptors.FieldDescriptor field,
714  java.lang.Object value) {
715  return super.addRepeatedField(field, value);
716  }
717  @java.lang.Override
718  public Builder mergeFrom(com.google.protobuf.Message other) {
719  if (other instanceof com.google.ortools.sat.ReservoirConstraintProto) {
720  return mergeFrom((com.google.ortools.sat.ReservoirConstraintProto)other);
721  } else {
722  super.mergeFrom(other);
723  return this;
724  }
725  }
726 
727  public Builder mergeFrom(com.google.ortools.sat.ReservoirConstraintProto other) {
728  if (other == com.google.ortools.sat.ReservoirConstraintProto.getDefaultInstance()) return this;
729  if (other.getMinLevel() != 0L) {
730  setMinLevel(other.getMinLevel());
731  }
732  if (other.getMaxLevel() != 0L) {
733  setMaxLevel(other.getMaxLevel());
734  }
735  if (!other.times_.isEmpty()) {
736  if (times_.isEmpty()) {
737  times_ = other.times_;
738  bitField0_ = (bitField0_ & ~0x00000001);
739  } else {
740  ensureTimesIsMutable();
741  times_.addAll(other.times_);
742  }
743  onChanged();
744  }
745  if (!other.demands_.isEmpty()) {
746  if (demands_.isEmpty()) {
747  demands_ = other.demands_;
748  bitField0_ = (bitField0_ & ~0x00000002);
749  } else {
750  ensureDemandsIsMutable();
751  demands_.addAll(other.demands_);
752  }
753  onChanged();
754  }
755  if (!other.actives_.isEmpty()) {
756  if (actives_.isEmpty()) {
757  actives_ = other.actives_;
758  bitField0_ = (bitField0_ & ~0x00000004);
759  } else {
760  ensureActivesIsMutable();
761  actives_.addAll(other.actives_);
762  }
763  onChanged();
764  }
765  this.mergeUnknownFields(other.unknownFields);
766  onChanged();
767  return this;
768  }
769 
770  @java.lang.Override
771  public final boolean isInitialized() {
772  return true;
773  }
774 
775  @java.lang.Override
777  com.google.protobuf.CodedInputStream input,
778  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
779  throws java.io.IOException {
780  com.google.ortools.sat.ReservoirConstraintProto parsedMessage = null;
781  try {
782  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
783  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
784  parsedMessage = (com.google.ortools.sat.ReservoirConstraintProto) e.getUnfinishedMessage();
785  throw e.unwrapIOException();
786  } finally {
787  if (parsedMessage != null) {
788  mergeFrom(parsedMessage);
789  }
790  }
791  return this;
792  }
793  private int bitField0_;
794 
795  private long minLevel_ ;
800  @java.lang.Override
801  public long getMinLevel() {
802  return minLevel_;
803  }
809  public Builder setMinLevel(long value) {
810 
811  minLevel_ = value;
812  onChanged();
813  return this;
814  }
820 
821  minLevel_ = 0L;
822  onChanged();
823  return this;
824  }
825 
826  private long maxLevel_ ;
831  @java.lang.Override
832  public long getMaxLevel() {
833  return maxLevel_;
834  }
840  public Builder setMaxLevel(long value) {
841 
842  maxLevel_ = value;
843  onChanged();
844  return this;
845  }
851 
852  maxLevel_ = 0L;
853  onChanged();
854  return this;
855  }
856 
857  private com.google.protobuf.Internal.IntList times_ = emptyIntList();
858  private void ensureTimesIsMutable() {
859  if (!((bitField0_ & 0x00000001) != 0)) {
860  times_ = mutableCopy(times_);
861  bitField0_ |= 0x00000001;
862  }
863  }
872  public java.util.List<java.lang.Integer>
874  return ((bitField0_ & 0x00000001) != 0) ?
875  java.util.Collections.unmodifiableList(times_) : times_;
876  }
885  public int getTimesCount() {
886  return times_.size();
887  }
897  public int getTimes(int index) {
898  return times_.getInt(index);
899  }
911  int index, int value) {
912  ensureTimesIsMutable();
913  times_.setInt(index, value);
914  onChanged();
915  return this;
916  }
926  public Builder addTimes(int value) {
927  ensureTimesIsMutable();
928  times_.addInt(value);
929  onChanged();
930  return this;
931  }
942  java.lang.Iterable<? extends java.lang.Integer> values) {
943  ensureTimesIsMutable();
944  com.google.protobuf.AbstractMessageLite.Builder.addAll(
945  values, times_);
946  onChanged();
947  return this;
948  }
957  public Builder clearTimes() {
958  times_ = emptyIntList();
959  bitField0_ = (bitField0_ & ~0x00000001);
960  onChanged();
961  return this;
962  }
963 
964  private com.google.protobuf.Internal.LongList demands_ = emptyLongList();
965  private void ensureDemandsIsMutable() {
966  if (!((bitField0_ & 0x00000002) != 0)) {
967  demands_ = mutableCopy(demands_);
968  bitField0_ |= 0x00000002;
969  }
970  }
979  public java.util.List<java.lang.Long>
981  return ((bitField0_ & 0x00000002) != 0) ?
982  java.util.Collections.unmodifiableList(demands_) : demands_;
983  }
992  public int getDemandsCount() {
993  return demands_.size();
994  }
1004  public long getDemands(int index) {
1005  return demands_.getLong(index);
1006  }
1018  int index, long value) {
1019  ensureDemandsIsMutable();
1020  demands_.setLong(index, value);
1021  onChanged();
1022  return this;
1023  }
1033  public Builder addDemands(long value) {
1034  ensureDemandsIsMutable();
1035  demands_.addLong(value);
1036  onChanged();
1037  return this;
1038  }
1049  java.lang.Iterable<? extends java.lang.Long> values) {
1050  ensureDemandsIsMutable();
1051  com.google.protobuf.AbstractMessageLite.Builder.addAll(
1052  values, demands_);
1053  onChanged();
1054  return this;
1055  }
1065  demands_ = emptyLongList();
1066  bitField0_ = (bitField0_ & ~0x00000002);
1067  onChanged();
1068  return this;
1069  }
1070 
1071  private com.google.protobuf.Internal.IntList actives_ = emptyIntList();
1072  private void ensureActivesIsMutable() {
1073  if (!((bitField0_ & 0x00000004) != 0)) {
1074  actives_ = mutableCopy(actives_);
1075  bitField0_ |= 0x00000004;
1076  }
1077  }
1086  public java.util.List<java.lang.Integer>
1088  return ((bitField0_ & 0x00000004) != 0) ?
1089  java.util.Collections.unmodifiableList(actives_) : actives_;
1090  }
1099  public int getActivesCount() {
1100  return actives_.size();
1101  }
1111  public int getActives(int index) {
1112  return actives_.getInt(index);
1113  }
1125  int index, int value) {
1126  ensureActivesIsMutable();
1127  actives_.setInt(index, value);
1128  onChanged();
1129  return this;
1130  }
1140  public Builder addActives(int value) {
1141  ensureActivesIsMutable();
1142  actives_.addInt(value);
1143  onChanged();
1144  return this;
1145  }
1156  java.lang.Iterable<? extends java.lang.Integer> values) {
1157  ensureActivesIsMutable();
1158  com.google.protobuf.AbstractMessageLite.Builder.addAll(
1159  values, actives_);
1160  onChanged();
1161  return this;
1162  }
1172  actives_ = emptyIntList();
1173  bitField0_ = (bitField0_ & ~0x00000004);
1174  onChanged();
1175  return this;
1176  }
1177  @java.lang.Override
1179  final com.google.protobuf.UnknownFieldSet unknownFields) {
1180  return super.setUnknownFields(unknownFields);
1181  }
1182 
1183  @java.lang.Override
1185  final com.google.protobuf.UnknownFieldSet unknownFields) {
1186  return super.mergeUnknownFields(unknownFields);
1187  }
1188 
1189 
1190  // @@protoc_insertion_point(builder_scope:operations_research.sat.ReservoirConstraintProto)
1191  }
1192 
1193  // @@protoc_insertion_point(class_scope:operations_research.sat.ReservoirConstraintProto)
1194  private static final com.google.ortools.sat.ReservoirConstraintProto DEFAULT_INSTANCE;
1195  static {
1196  DEFAULT_INSTANCE = new com.google.ortools.sat.ReservoirConstraintProto();
1197  }
1198 
1199  public static com.google.ortools.sat.ReservoirConstraintProto getDefaultInstance() {
1200  return DEFAULT_INSTANCE;
1201  }
1202 
1203  private static final com.google.protobuf.Parser<ReservoirConstraintProto>
1204  PARSER = new com.google.protobuf.AbstractParser<ReservoirConstraintProto>() {
1205  @java.lang.Override
1206  public ReservoirConstraintProto parsePartialFrom(
1207  com.google.protobuf.CodedInputStream input,
1208  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1209  throws com.google.protobuf.InvalidProtocolBufferException {
1210  return new ReservoirConstraintProto(input, extensionRegistry);
1211  }
1212  };
1213 
1214  public static com.google.protobuf.Parser<ReservoirConstraintProto> parser() {
1215  return PARSER;
1216  }
1217 
1218  @java.lang.Override
1219  public com.google.protobuf.Parser<ReservoirConstraintProto> getParserForType() {
1220  return PARSER;
1221  }
1222 
1223  @java.lang.Override
1224  public com.google.ortools.sat.ReservoirConstraintProto getDefaultInstanceForType() {
1225  return DEFAULT_INSTANCE;
1226  }
1227 
1228 }
1229 
.lang.Override com.google.ortools.sat.ReservoirConstraintProto getDefaultInstanceForType()
.lang.Override com.google.ortools.sat.ReservoirConstraintProto build()
.lang.Override Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
.lang.Override Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
Builder addAllDemands(java.lang.Iterable<? extends java.lang.Long > values)
.lang.Override final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
Builder addAllActives(java.lang.Iterable<? extends java.lang.Integer > values)
.lang.Override com.google.ortools.sat.ReservoirConstraintProto buildPartial()
.lang.Override Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder addAllTimes(java.lang.Iterable<? extends java.lang.Integer > values)
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
.lang.Override final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder mergeFrom(com.google.ortools.sat.ReservoirConstraintProto other)
.lang.Override Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
.lang.Override Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
.lang.Override com.google.ortools.sat.ReservoirConstraintProto getDefaultInstanceForType()
static com.google.ortools.sat.ReservoirConstraintProto parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.sat.ReservoirConstraintProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override com.google.protobuf.Parser< ReservoirConstraintProto > getParserForType()
static Builder newBuilder(com.google.ortools.sat.ReservoirConstraintProto prototype)
static com.google.ortools.sat.ReservoirConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
static com.google.ortools.sat.ReservoirConstraintProto parseFrom(java.io.InputStream input)
static com.google.ortools.sat.ReservoirConstraintProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.ReservoirConstraintProto parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.sat.ReservoirConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.ReservoirConstraintProto getDefaultInstance()
static com.google.ortools.sat.ReservoirConstraintProto parseFrom(byte[] data)
.lang.Override void writeTo(com.google.protobuf.CodedOutputStream output)
.lang.Override java.util.List< java.lang.Integer > getTimesList()
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
.lang.Override final com.google.protobuf.UnknownFieldSet getUnknownFields()
.lang.Override java.util.List< java.lang.Long > getDemandsList()
static com.google.protobuf.Parser< ReservoirConstraintProto > parser()
static com.google.ortools.sat.ReservoirConstraintProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.ReservoirConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override java.lang.Object newInstance(UnusedPrivateParameter unused)
.lang.Override java.util.List< java.lang.Integer > getActivesList()
.lang.Override boolean equals(final java.lang.Object obj)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.sat.ReservoirConstraintProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override long getMaxLevel()
int64 max_level = 2;
.lang.Override long getMinLevel()
int64 min_level = 1;
static com.google.ortools.sat.ReservoirConstraintProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)