Java Reference

Java Reference

CpModelProto.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 
13 public final class CpModelProto extends
14  com.google.protobuf.GeneratedMessageV3 implements
15  // @@protoc_insertion_point(message_implements:operations_research.sat.CpModelProto)
17 private static final long serialVersionUID = 0L;
18  // Use CpModelProto.newBuilder() to construct.
19  private CpModelProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
20  super(builder);
21  }
22  private CpModelProto() {
23  name_ = "";
24  variables_ = java.util.Collections.emptyList();
25  constraints_ = java.util.Collections.emptyList();
26  searchStrategy_ = java.util.Collections.emptyList();
27  assumptions_ = emptyIntList();
28  }
29 
30  @java.lang.Override
31  @SuppressWarnings({"unused"})
32  protected java.lang.Object newInstance(
33  UnusedPrivateParameter unused) {
34  return new CpModelProto();
35  }
36 
37  @java.lang.Override
38  public final com.google.protobuf.UnknownFieldSet
40  return this.unknownFields;
41  }
42  private CpModelProto(
43  com.google.protobuf.CodedInputStream input,
44  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
45  throws com.google.protobuf.InvalidProtocolBufferException {
46  this();
47  if (extensionRegistry == null) {
48  throw new java.lang.NullPointerException();
49  }
50  int mutable_bitField0_ = 0;
51  com.google.protobuf.UnknownFieldSet.Builder unknownFields =
52  com.google.protobuf.UnknownFieldSet.newBuilder();
53  try {
54  boolean done = false;
55  while (!done) {
56  int tag = input.readTag();
57  switch (tag) {
58  case 0:
59  done = true;
60  break;
61  case 10: {
62  java.lang.String s = input.readStringRequireUtf8();
63 
64  name_ = s;
65  break;
66  }
67  case 18: {
68  if (!((mutable_bitField0_ & 0x00000001) != 0)) {
69  variables_ = new java.util.ArrayList<com.google.ortools.sat.IntegerVariableProto>();
70  mutable_bitField0_ |= 0x00000001;
71  }
72  variables_.add(
73  input.readMessage(com.google.ortools.sat.IntegerVariableProto.parser(), extensionRegistry));
74  break;
75  }
76  case 26: {
77  if (!((mutable_bitField0_ & 0x00000002) != 0)) {
78  constraints_ = new java.util.ArrayList<com.google.ortools.sat.ConstraintProto>();
79  mutable_bitField0_ |= 0x00000002;
80  }
81  constraints_.add(
82  input.readMessage(com.google.ortools.sat.ConstraintProto.parser(), extensionRegistry));
83  break;
84  }
85  case 34: {
86  com.google.ortools.sat.CpObjectiveProto.Builder subBuilder = null;
87  if (objective_ != null) {
88  subBuilder = objective_.toBuilder();
89  }
90  objective_ = input.readMessage(com.google.ortools.sat.CpObjectiveProto.parser(), extensionRegistry);
91  if (subBuilder != null) {
92  subBuilder.mergeFrom(objective_);
93  objective_ = subBuilder.buildPartial();
94  }
95 
96  break;
97  }
98  case 42: {
99  if (!((mutable_bitField0_ & 0x00000004) != 0)) {
100  searchStrategy_ = new java.util.ArrayList<com.google.ortools.sat.DecisionStrategyProto>();
101  mutable_bitField0_ |= 0x00000004;
102  }
103  searchStrategy_.add(
104  input.readMessage(com.google.ortools.sat.DecisionStrategyProto.parser(), extensionRegistry));
105  break;
106  }
107  case 50: {
109  if (solutionHint_ != null) {
110  subBuilder = solutionHint_.toBuilder();
111  }
112  solutionHint_ = input.readMessage(com.google.ortools.sat.PartialVariableAssignment.parser(), extensionRegistry);
113  if (subBuilder != null) {
114  subBuilder.mergeFrom(solutionHint_);
115  solutionHint_ = subBuilder.buildPartial();
116  }
117 
118  break;
119  }
120  case 56: {
121  if (!((mutable_bitField0_ & 0x00000008) != 0)) {
122  assumptions_ = newIntList();
123  mutable_bitField0_ |= 0x00000008;
124  }
125  assumptions_.addInt(input.readInt32());
126  break;
127  }
128  case 58: {
129  int length = input.readRawVarint32();
130  int limit = input.pushLimit(length);
131  if (!((mutable_bitField0_ & 0x00000008) != 0) && input.getBytesUntilLimit() > 0) {
132  assumptions_ = newIntList();
133  mutable_bitField0_ |= 0x00000008;
134  }
135  while (input.getBytesUntilLimit() > 0) {
136  assumptions_.addInt(input.readInt32());
137  }
138  input.popLimit(limit);
139  break;
140  }
141  default: {
142  if (!parseUnknownField(
143  input, unknownFields, extensionRegistry, tag)) {
144  done = true;
145  }
146  break;
147  }
148  }
149  }
150  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
151  throw e.setUnfinishedMessage(this);
152  } catch (java.io.IOException e) {
153  throw new com.google.protobuf.InvalidProtocolBufferException(
154  e).setUnfinishedMessage(this);
155  } finally {
156  if (((mutable_bitField0_ & 0x00000001) != 0)) {
157  variables_ = java.util.Collections.unmodifiableList(variables_);
158  }
159  if (((mutable_bitField0_ & 0x00000002) != 0)) {
160  constraints_ = java.util.Collections.unmodifiableList(constraints_);
161  }
162  if (((mutable_bitField0_ & 0x00000004) != 0)) {
163  searchStrategy_ = java.util.Collections.unmodifiableList(searchStrategy_);
164  }
165  if (((mutable_bitField0_ & 0x00000008) != 0)) {
166  assumptions_.makeImmutable(); // C
167  }
168  this.unknownFields = unknownFields.build();
169  makeExtensionsImmutable();
170  }
171  }
172  public static final com.google.protobuf.Descriptors.Descriptor
174  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
175  }
176 
177  @java.lang.Override
178  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
180  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_fieldAccessorTable
181  .ensureFieldAccessorsInitialized(
183  }
184 
185  public static final int NAME_FIELD_NUMBER = 1;
186  private volatile java.lang.Object name_;
195  public java.lang.String getName() {
196  java.lang.Object ref = name_;
197  if (ref instanceof java.lang.String) {
198  return (java.lang.String) ref;
199  } else {
200  com.google.protobuf.ByteString bs =
201  (com.google.protobuf.ByteString) ref;
202  java.lang.String s = bs.toStringUtf8();
203  name_ = s;
204  return s;
205  }
206  }
215  public com.google.protobuf.ByteString
217  java.lang.Object ref = name_;
218  if (ref instanceof java.lang.String) {
219  com.google.protobuf.ByteString b =
220  com.google.protobuf.ByteString.copyFromUtf8(
221  (java.lang.String) ref);
222  name_ = b;
223  return b;
224  } else {
225  return (com.google.protobuf.ByteString) ref;
226  }
227  }
228 
229  public static final int VARIABLES_FIELD_NUMBER = 2;
230  private java.util.List<com.google.ortools.sat.IntegerVariableProto> variables_;
239  return variables_;
240  }
248  public java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder>
250  return variables_;
251  }
259  public int getVariablesCount() {
260  return variables_.size();
261  }
270  return variables_.get(index);
271  }
280  int index) {
281  return variables_.get(index);
282  }
283 
284  public static final int CONSTRAINTS_FIELD_NUMBER = 3;
285  private java.util.List<com.google.ortools.sat.ConstraintProto> constraints_;
290  return constraints_;
291  }
295  public java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder>
297  return constraints_;
298  }
302  public int getConstraintsCount() {
303  return constraints_.size();
304  }
309  return constraints_.get(index);
310  }
315  int index) {
316  return constraints_.get(index);
317  }
318 
319  public static final int OBJECTIVE_FIELD_NUMBER = 4;
320  private com.google.ortools.sat.CpObjectiveProto objective_;
329  public boolean hasObjective() {
330  return objective_ != null;
331  }
341  return objective_ == null ? com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
342  }
351  return getObjective();
352  }
353 
354  public static final int SEARCH_STRATEGY_FIELD_NUMBER = 5;
355  private java.util.List<com.google.ortools.sat.DecisionStrategyProto> searchStrategy_;
372  return searchStrategy_;
373  }
389  public java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
391  return searchStrategy_;
392  }
408  public int getSearchStrategyCount() {
409  return searchStrategy_.size();
410  }
427  return searchStrategy_.get(index);
428  }
445  int index) {
446  return searchStrategy_.get(index);
447  }
448 
449  public static final int SOLUTION_HINT_FIELD_NUMBER = 6;
450  private com.google.ortools.sat.PartialVariableAssignment solutionHint_;
467  public boolean hasSolutionHint() {
468  return solutionHint_ != null;
469  }
487  return solutionHint_ == null ? com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
488  }
505  return getSolutionHint();
506  }
507 
508  public static final int ASSUMPTIONS_FIELD_NUMBER = 7;
509  private com.google.protobuf.Internal.IntList assumptions_;
528  public java.util.List<java.lang.Integer>
530  return assumptions_;
531  }
550  public int getAssumptionsCount() {
551  return assumptions_.size();
552  }
572  public int getAssumptions(int index) {
573  return assumptions_.getInt(index);
574  }
575  private int assumptionsMemoizedSerializedSize = -1;
576 
577  private byte memoizedIsInitialized = -1;
578  @java.lang.Override
579  public final boolean isInitialized() {
580  byte isInitialized = memoizedIsInitialized;
581  if (isInitialized == 1) return true;
582  if (isInitialized == 0) return false;
583 
584  memoizedIsInitialized = 1;
585  return true;
586  }
587 
588  @java.lang.Override
589  public void writeTo(com.google.protobuf.CodedOutputStream output)
590  throws java.io.IOException {
592  if (!getNameBytes().isEmpty()) {
593  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
594  }
595  for (int i = 0; i < variables_.size(); i++) {
596  output.writeMessage(2, variables_.get(i));
597  }
598  for (int i = 0; i < constraints_.size(); i++) {
599  output.writeMessage(3, constraints_.get(i));
600  }
601  if (objective_ != null) {
602  output.writeMessage(4, getObjective());
603  }
604  for (int i = 0; i < searchStrategy_.size(); i++) {
605  output.writeMessage(5, searchStrategy_.get(i));
606  }
607  if (solutionHint_ != null) {
608  output.writeMessage(6, getSolutionHint());
609  }
610  if (getAssumptionsList().size() > 0) {
611  output.writeUInt32NoTag(58);
612  output.writeUInt32NoTag(assumptionsMemoizedSerializedSize);
613  }
614  for (int i = 0; i < assumptions_.size(); i++) {
615  output.writeInt32NoTag(assumptions_.getInt(i));
616  }
617  unknownFields.writeTo(output);
618  }
619 
620  @java.lang.Override
621  public int getSerializedSize() {
622  int size = memoizedSize;
623  if (size != -1) return size;
624 
625  size = 0;
626  if (!getNameBytes().isEmpty()) {
627  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
628  }
629  for (int i = 0; i < variables_.size(); i++) {
630  size += com.google.protobuf.CodedOutputStream
631  .computeMessageSize(2, variables_.get(i));
632  }
633  for (int i = 0; i < constraints_.size(); i++) {
634  size += com.google.protobuf.CodedOutputStream
635  .computeMessageSize(3, constraints_.get(i));
636  }
637  if (objective_ != null) {
638  size += com.google.protobuf.CodedOutputStream
639  .computeMessageSize(4, getObjective());
640  }
641  for (int i = 0; i < searchStrategy_.size(); i++) {
642  size += com.google.protobuf.CodedOutputStream
643  .computeMessageSize(5, searchStrategy_.get(i));
644  }
645  if (solutionHint_ != null) {
646  size += com.google.protobuf.CodedOutputStream
647  .computeMessageSize(6, getSolutionHint());
648  }
649  {
650  int dataSize = 0;
651  for (int i = 0; i < assumptions_.size(); i++) {
652  dataSize += com.google.protobuf.CodedOutputStream
653  .computeInt32SizeNoTag(assumptions_.getInt(i));
654  }
655  size += dataSize;
656  if (!getAssumptionsList().isEmpty()) {
657  size += 1;
658  size += com.google.protobuf.CodedOutputStream
659  .computeInt32SizeNoTag(dataSize);
660  }
661  assumptionsMemoizedSerializedSize = dataSize;
662  }
663  size += unknownFields.getSerializedSize();
664  memoizedSize = size;
665  return size;
666  }
667 
668  @java.lang.Override
669  public boolean equals(final java.lang.Object obj) {
670  if (obj == this) {
671  return true;
672  }
673  if (!(obj instanceof com.google.ortools.sat.CpModelProto)) {
674  return super.equals(obj);
675  }
677 
678  if (!getName()
679  .equals(other.getName())) return false;
680  if (!getVariablesList()
681  .equals(other.getVariablesList())) return false;
682  if (!getConstraintsList()
683  .equals(other.getConstraintsList())) return false;
684  if (hasObjective() != other.hasObjective()) return false;
685  if (hasObjective()) {
686  if (!getObjective()
687  .equals(other.getObjective())) return false;
688  }
689  if (!getSearchStrategyList()
690  .equals(other.getSearchStrategyList())) return false;
691  if (hasSolutionHint() != other.hasSolutionHint()) return false;
692  if (hasSolutionHint()) {
693  if (!getSolutionHint()
694  .equals(other.getSolutionHint())) return false;
695  }
696  if (!getAssumptionsList()
697  .equals(other.getAssumptionsList())) return false;
698  if (!unknownFields.equals(other.unknownFields)) return false;
699  return true;
700  }
701 
702  @java.lang.Override
703  public int hashCode() {
704  if (memoizedHashCode != 0) {
705  return memoizedHashCode;
706  }
707  int hash = 41;
708  hash = (19 * hash) + getDescriptor().hashCode();
709  hash = (37 * hash) + NAME_FIELD_NUMBER;
710  hash = (53 * hash) + getName().hashCode();
711  if (getVariablesCount() > 0) {
712  hash = (37 * hash) + VARIABLES_FIELD_NUMBER;
713  hash = (53 * hash) + getVariablesList().hashCode();
714  }
715  if (getConstraintsCount() > 0) {
716  hash = (37 * hash) + CONSTRAINTS_FIELD_NUMBER;
717  hash = (53 * hash) + getConstraintsList().hashCode();
718  }
719  if (hasObjective()) {
720  hash = (37 * hash) + OBJECTIVE_FIELD_NUMBER;
721  hash = (53 * hash) + getObjective().hashCode();
722  }
723  if (getSearchStrategyCount() > 0) {
724  hash = (37 * hash) + SEARCH_STRATEGY_FIELD_NUMBER;
725  hash = (53 * hash) + getSearchStrategyList().hashCode();
726  }
727  if (hasSolutionHint()) {
728  hash = (37 * hash) + SOLUTION_HINT_FIELD_NUMBER;
729  hash = (53 * hash) + getSolutionHint().hashCode();
730  }
731  if (getAssumptionsCount() > 0) {
732  hash = (37 * hash) + ASSUMPTIONS_FIELD_NUMBER;
733  hash = (53 * hash) + getAssumptionsList().hashCode();
734  }
735  hash = (29 * hash) + unknownFields.hashCode();
736  memoizedHashCode = hash;
737  return hash;
738  }
739 
741  java.nio.ByteBuffer data)
742  throws com.google.protobuf.InvalidProtocolBufferException {
743  return PARSER.parseFrom(data);
744  }
746  java.nio.ByteBuffer data,
747  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
748  throws com.google.protobuf.InvalidProtocolBufferException {
749  return PARSER.parseFrom(data, extensionRegistry);
750  }
752  com.google.protobuf.ByteString data)
753  throws com.google.protobuf.InvalidProtocolBufferException {
754  return PARSER.parseFrom(data);
755  }
757  com.google.protobuf.ByteString data,
758  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
759  throws com.google.protobuf.InvalidProtocolBufferException {
760  return PARSER.parseFrom(data, extensionRegistry);
761  }
762  public static com.google.ortools.sat.CpModelProto parseFrom(byte[] data)
763  throws com.google.protobuf.InvalidProtocolBufferException {
764  return PARSER.parseFrom(data);
765  }
767  byte[] data,
768  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
769  throws com.google.protobuf.InvalidProtocolBufferException {
770  return PARSER.parseFrom(data, extensionRegistry);
771  }
772  public static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input)
773  throws java.io.IOException {
774  return com.google.protobuf.GeneratedMessageV3
775  .parseWithIOException(PARSER, input);
776  }
778  java.io.InputStream input,
779  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
780  throws java.io.IOException {
781  return com.google.protobuf.GeneratedMessageV3
782  .parseWithIOException(PARSER, input, extensionRegistry);
783  }
784  public static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input)
785  throws java.io.IOException {
786  return com.google.protobuf.GeneratedMessageV3
787  .parseDelimitedWithIOException(PARSER, input);
788  }
790  java.io.InputStream input,
791  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
792  throws java.io.IOException {
793  return com.google.protobuf.GeneratedMessageV3
794  .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
795  }
797  com.google.protobuf.CodedInputStream input)
798  throws java.io.IOException {
799  return com.google.protobuf.GeneratedMessageV3
800  .parseWithIOException(PARSER, input);
801  }
803  com.google.protobuf.CodedInputStream input,
804  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
805  throws java.io.IOException {
806  return com.google.protobuf.GeneratedMessageV3
807  .parseWithIOException(PARSER, input, extensionRegistry);
808  }
809 
810  @java.lang.Override
811  public Builder newBuilderForType() { return newBuilder(); }
812  public static Builder newBuilder() {
813  return DEFAULT_INSTANCE.toBuilder();
814  }
815  public static Builder newBuilder(com.google.ortools.sat.CpModelProto prototype) {
816  return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
817  }
818  @java.lang.Override
819  public Builder toBuilder() {
820  return this == DEFAULT_INSTANCE
821  ? new Builder() : new Builder().mergeFrom(this);
822  }
823 
824  @java.lang.Override
826  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
827  Builder builder = new Builder(parent);
828  return builder;
829  }
837  public static final class Builder extends
838  com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
839  // @@protoc_insertion_point(builder_implements:operations_research.sat.CpModelProto)
840  com.google.ortools.sat.CpModelProtoOrBuilder {
841  public static final com.google.protobuf.Descriptors.Descriptor
843  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
844  }
845 
846  @java.lang.Override
847  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
849  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_fieldAccessorTable
850  .ensureFieldAccessorsInitialized(
852  }
853 
854  // Construct using com.google.ortools.sat.CpModelProto.newBuilder()
855  private Builder() {
856  maybeForceBuilderInitialization();
857  }
858 
859  private Builder(
860  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
861  super(parent);
862  maybeForceBuilderInitialization();
863  }
864  private void maybeForceBuilderInitialization() {
865  if (com.google.protobuf.GeneratedMessageV3
866  .alwaysUseFieldBuilders) {
867  getVariablesFieldBuilder();
868  getConstraintsFieldBuilder();
869  getSearchStrategyFieldBuilder();
870  }
871  }
872  @java.lang.Override
873  public Builder clear() {
874  super.clear();
875  name_ = "";
876 
877  if (variablesBuilder_ == null) {
878  variables_ = java.util.Collections.emptyList();
879  bitField0_ = (bitField0_ & ~0x00000001);
880  } else {
881  variablesBuilder_.clear();
882  }
883  if (constraintsBuilder_ == null) {
884  constraints_ = java.util.Collections.emptyList();
885  bitField0_ = (bitField0_ & ~0x00000002);
886  } else {
887  constraintsBuilder_.clear();
888  }
889  if (objectiveBuilder_ == null) {
890  objective_ = null;
891  } else {
892  objective_ = null;
893  objectiveBuilder_ = null;
894  }
895  if (searchStrategyBuilder_ == null) {
896  searchStrategy_ = java.util.Collections.emptyList();
897  bitField0_ = (bitField0_ & ~0x00000004);
898  } else {
899  searchStrategyBuilder_.clear();
900  }
901  if (solutionHintBuilder_ == null) {
902  solutionHint_ = null;
903  } else {
904  solutionHint_ = null;
905  solutionHintBuilder_ = null;
906  }
907  assumptions_ = emptyIntList();
908  bitField0_ = (bitField0_ & ~0x00000008);
909  return this;
910  }
911 
912  @java.lang.Override
913  public com.google.protobuf.Descriptors.Descriptor
915  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
916  }
917 
918  @java.lang.Override
921  }
922 
923  @java.lang.Override
926  if (!result.isInitialized()) {
927  throw newUninitializedMessageException(result);
928  }
929  return result;
930  }
931 
932  @java.lang.Override
935  int from_bitField0_ = bitField0_;
936  result.name_ = name_;
937  if (variablesBuilder_ == null) {
938  if (((bitField0_ & 0x00000001) != 0)) {
939  variables_ = java.util.Collections.unmodifiableList(variables_);
940  bitField0_ = (bitField0_ & ~0x00000001);
941  }
942  result.variables_ = variables_;
943  } else {
944  result.variables_ = variablesBuilder_.build();
945  }
946  if (constraintsBuilder_ == null) {
947  if (((bitField0_ & 0x00000002) != 0)) {
948  constraints_ = java.util.Collections.unmodifiableList(constraints_);
949  bitField0_ = (bitField0_ & ~0x00000002);
950  }
951  result.constraints_ = constraints_;
952  } else {
953  result.constraints_ = constraintsBuilder_.build();
954  }
955  if (objectiveBuilder_ == null) {
956  result.objective_ = objective_;
957  } else {
958  result.objective_ = objectiveBuilder_.build();
959  }
960  if (searchStrategyBuilder_ == null) {
961  if (((bitField0_ & 0x00000004) != 0)) {
962  searchStrategy_ = java.util.Collections.unmodifiableList(searchStrategy_);
963  bitField0_ = (bitField0_ & ~0x00000004);
964  }
965  result.searchStrategy_ = searchStrategy_;
966  } else {
967  result.searchStrategy_ = searchStrategyBuilder_.build();
968  }
969  if (solutionHintBuilder_ == null) {
970  result.solutionHint_ = solutionHint_;
971  } else {
972  result.solutionHint_ = solutionHintBuilder_.build();
973  }
974  if (((bitField0_ & 0x00000008) != 0)) {
975  assumptions_.makeImmutable();
976  bitField0_ = (bitField0_ & ~0x00000008);
977  }
978  result.assumptions_ = assumptions_;
979  onBuilt();
980  return result;
981  }
982 
983  @java.lang.Override
984  public Builder clone() {
985  return super.clone();
986  }
987  @java.lang.Override
989  com.google.protobuf.Descriptors.FieldDescriptor field,
990  java.lang.Object value) {
991  return super.setField(field, value);
992  }
993  @java.lang.Override
995  com.google.protobuf.Descriptors.FieldDescriptor field) {
996  return super.clearField(field);
997  }
998  @java.lang.Override
1000  com.google.protobuf.Descriptors.OneofDescriptor oneof) {
1001  return super.clearOneof(oneof);
1002  }
1003  @java.lang.Override
1005  com.google.protobuf.Descriptors.FieldDescriptor field,
1006  int index, java.lang.Object value) {
1007  return super.setRepeatedField(field, index, value);
1008  }
1009  @java.lang.Override
1011  com.google.protobuf.Descriptors.FieldDescriptor field,
1012  java.lang.Object value) {
1013  return super.addRepeatedField(field, value);
1014  }
1015  @java.lang.Override
1016  public Builder mergeFrom(com.google.protobuf.Message other) {
1017  if (other instanceof com.google.ortools.sat.CpModelProto) {
1018  return mergeFrom((com.google.ortools.sat.CpModelProto)other);
1019  } else {
1020  super.mergeFrom(other);
1021  return this;
1022  }
1023  }
1024 
1026  if (other == com.google.ortools.sat.CpModelProto.getDefaultInstance()) return this;
1027  if (!other.getName().isEmpty()) {
1028  name_ = other.name_;
1029  onChanged();
1030  }
1031  if (variablesBuilder_ == null) {
1032  if (!other.variables_.isEmpty()) {
1033  if (variables_.isEmpty()) {
1034  variables_ = other.variables_;
1035  bitField0_ = (bitField0_ & ~0x00000001);
1036  } else {
1037  ensureVariablesIsMutable();
1038  variables_.addAll(other.variables_);
1039  }
1040  onChanged();
1041  }
1042  } else {
1043  if (!other.variables_.isEmpty()) {
1044  if (variablesBuilder_.isEmpty()) {
1045  variablesBuilder_.dispose();
1046  variablesBuilder_ = null;
1047  variables_ = other.variables_;
1048  bitField0_ = (bitField0_ & ~0x00000001);
1049  variablesBuilder_ =
1050  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
1051  getVariablesFieldBuilder() : null;
1052  } else {
1053  variablesBuilder_.addAllMessages(other.variables_);
1054  }
1055  }
1056  }
1057  if (constraintsBuilder_ == null) {
1058  if (!other.constraints_.isEmpty()) {
1059  if (constraints_.isEmpty()) {
1060  constraints_ = other.constraints_;
1061  bitField0_ = (bitField0_ & ~0x00000002);
1062  } else {
1063  ensureConstraintsIsMutable();
1064  constraints_.addAll(other.constraints_);
1065  }
1066  onChanged();
1067  }
1068  } else {
1069  if (!other.constraints_.isEmpty()) {
1070  if (constraintsBuilder_.isEmpty()) {
1071  constraintsBuilder_.dispose();
1072  constraintsBuilder_ = null;
1073  constraints_ = other.constraints_;
1074  bitField0_ = (bitField0_ & ~0x00000002);
1075  constraintsBuilder_ =
1076  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
1077  getConstraintsFieldBuilder() : null;
1078  } else {
1079  constraintsBuilder_.addAllMessages(other.constraints_);
1080  }
1081  }
1082  }
1083  if (other.hasObjective()) {
1084  mergeObjective(other.getObjective());
1085  }
1086  if (searchStrategyBuilder_ == null) {
1087  if (!other.searchStrategy_.isEmpty()) {
1088  if (searchStrategy_.isEmpty()) {
1089  searchStrategy_ = other.searchStrategy_;
1090  bitField0_ = (bitField0_ & ~0x00000004);
1091  } else {
1092  ensureSearchStrategyIsMutable();
1093  searchStrategy_.addAll(other.searchStrategy_);
1094  }
1095  onChanged();
1096  }
1097  } else {
1098  if (!other.searchStrategy_.isEmpty()) {
1099  if (searchStrategyBuilder_.isEmpty()) {
1100  searchStrategyBuilder_.dispose();
1101  searchStrategyBuilder_ = null;
1102  searchStrategy_ = other.searchStrategy_;
1103  bitField0_ = (bitField0_ & ~0x00000004);
1104  searchStrategyBuilder_ =
1105  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
1106  getSearchStrategyFieldBuilder() : null;
1107  } else {
1108  searchStrategyBuilder_.addAllMessages(other.searchStrategy_);
1109  }
1110  }
1111  }
1112  if (other.hasSolutionHint()) {
1113  mergeSolutionHint(other.getSolutionHint());
1114  }
1115  if (!other.assumptions_.isEmpty()) {
1116  if (assumptions_.isEmpty()) {
1117  assumptions_ = other.assumptions_;
1118  bitField0_ = (bitField0_ & ~0x00000008);
1119  } else {
1120  ensureAssumptionsIsMutable();
1121  assumptions_.addAll(other.assumptions_);
1122  }
1123  onChanged();
1124  }
1125  this.mergeUnknownFields(other.unknownFields);
1126  onChanged();
1127  return this;
1128  }
1129 
1130  @java.lang.Override
1131  public final boolean isInitialized() {
1132  return true;
1133  }
1134 
1135  @java.lang.Override
1137  com.google.protobuf.CodedInputStream input,
1138  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1139  throws java.io.IOException {
1140  com.google.ortools.sat.CpModelProto parsedMessage = null;
1141  try {
1142  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
1143  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1144  parsedMessage = (com.google.ortools.sat.CpModelProto) e.getUnfinishedMessage();
1145  throw e.unwrapIOException();
1146  } finally {
1147  if (parsedMessage != null) {
1148  mergeFrom(parsedMessage);
1149  }
1150  }
1151  return this;
1152  }
1153  private int bitField0_;
1154 
1155  private java.lang.Object name_ = "";
1164  public java.lang.String getName() {
1165  java.lang.Object ref = name_;
1166  if (!(ref instanceof java.lang.String)) {
1167  com.google.protobuf.ByteString bs =
1168  (com.google.protobuf.ByteString) ref;
1169  java.lang.String s = bs.toStringUtf8();
1170  name_ = s;
1171  return s;
1172  } else {
1173  return (java.lang.String) ref;
1174  }
1175  }
1184  public com.google.protobuf.ByteString
1186  java.lang.Object ref = name_;
1187  if (ref instanceof String) {
1188  com.google.protobuf.ByteString b =
1189  com.google.protobuf.ByteString.copyFromUtf8(
1190  (java.lang.String) ref);
1191  name_ = b;
1192  return b;
1193  } else {
1194  return (com.google.protobuf.ByteString) ref;
1195  }
1196  }
1207  java.lang.String value) {
1208  if (value == null) {
1209  throw new NullPointerException();
1210  }
1211 
1212  name_ = value;
1213  onChanged();
1214  return this;
1215  }
1224  public Builder clearName() {
1225 
1226  name_ = getDefaultInstance().getName();
1227  onChanged();
1228  return this;
1229  }
1240  com.google.protobuf.ByteString value) {
1241  if (value == null) {
1242  throw new NullPointerException();
1243  }
1244  checkByteStringIsUtf8(value);
1245 
1246  name_ = value;
1247  onChanged();
1248  return this;
1249  }
1250 
1251  private java.util.List<com.google.ortools.sat.IntegerVariableProto> variables_ =
1252  java.util.Collections.emptyList();
1253  private void ensureVariablesIsMutable() {
1254  if (!((bitField0_ & 0x00000001) != 0)) {
1255  variables_ = new java.util.ArrayList<com.google.ortools.sat.IntegerVariableProto>(variables_);
1256  bitField0_ |= 0x00000001;
1257  }
1258  }
1259 
1260  private com.google.protobuf.RepeatedFieldBuilderV3<
1262 
1271  if (variablesBuilder_ == null) {
1272  return java.util.Collections.unmodifiableList(variables_);
1273  } else {
1274  return variablesBuilder_.getMessageList();
1275  }
1276  }
1284  public int getVariablesCount() {
1285  if (variablesBuilder_ == null) {
1286  return variables_.size();
1287  } else {
1288  return variablesBuilder_.getCount();
1289  }
1290  }
1299  if (variablesBuilder_ == null) {
1300  return variables_.get(index);
1301  } else {
1302  return variablesBuilder_.getMessage(index);
1303  }
1304  }
1313  int index, com.google.ortools.sat.IntegerVariableProto value) {
1314  if (variablesBuilder_ == null) {
1315  if (value == null) {
1316  throw new NullPointerException();
1317  }
1318  ensureVariablesIsMutable();
1319  variables_.set(index, value);
1320  onChanged();
1321  } else {
1322  variablesBuilder_.setMessage(index, value);
1323  }
1324  return this;
1325  }
1334  int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1335  if (variablesBuilder_ == null) {
1336  ensureVariablesIsMutable();
1337  variables_.set(index, builderForValue.build());
1338  onChanged();
1339  } else {
1340  variablesBuilder_.setMessage(index, builderForValue.build());
1341  }
1342  return this;
1343  }
1352  if (variablesBuilder_ == null) {
1353  if (value == null) {
1354  throw new NullPointerException();
1355  }
1356  ensureVariablesIsMutable();
1357  variables_.add(value);
1358  onChanged();
1359  } else {
1360  variablesBuilder_.addMessage(value);
1361  }
1362  return this;
1363  }
1372  int index, com.google.ortools.sat.IntegerVariableProto value) {
1373  if (variablesBuilder_ == null) {
1374  if (value == null) {
1375  throw new NullPointerException();
1376  }
1377  ensureVariablesIsMutable();
1378  variables_.add(index, value);
1379  onChanged();
1380  } else {
1381  variablesBuilder_.addMessage(index, value);
1382  }
1383  return this;
1384  }
1393  com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1394  if (variablesBuilder_ == null) {
1395  ensureVariablesIsMutable();
1396  variables_.add(builderForValue.build());
1397  onChanged();
1398  } else {
1399  variablesBuilder_.addMessage(builderForValue.build());
1400  }
1401  return this;
1402  }
1411  int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1412  if (variablesBuilder_ == null) {
1413  ensureVariablesIsMutable();
1414  variables_.add(index, builderForValue.build());
1415  onChanged();
1416  } else {
1417  variablesBuilder_.addMessage(index, builderForValue.build());
1418  }
1419  return this;
1420  }
1429  java.lang.Iterable<? extends com.google.ortools.sat.IntegerVariableProto> values) {
1430  if (variablesBuilder_ == null) {
1431  ensureVariablesIsMutable();
1432  com.google.protobuf.AbstractMessageLite.Builder.addAll(
1433  values, variables_);
1434  onChanged();
1435  } else {
1436  variablesBuilder_.addAllMessages(values);
1437  }
1438  return this;
1439  }
1448  if (variablesBuilder_ == null) {
1449  variables_ = java.util.Collections.emptyList();
1450  bitField0_ = (bitField0_ & ~0x00000001);
1451  onChanged();
1452  } else {
1453  variablesBuilder_.clear();
1454  }
1455  return this;
1456  }
1464  public Builder removeVariables(int index) {
1465  if (variablesBuilder_ == null) {
1466  ensureVariablesIsMutable();
1467  variables_.remove(index);
1468  onChanged();
1469  } else {
1470  variablesBuilder_.remove(index);
1471  }
1472  return this;
1473  }
1482  int index) {
1483  return getVariablesFieldBuilder().getBuilder(index);
1484  }
1493  int index) {
1494  if (variablesBuilder_ == null) {
1495  return variables_.get(index); } else {
1496  return variablesBuilder_.getMessageOrBuilder(index);
1497  }
1498  }
1506  public java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder>
1508  if (variablesBuilder_ != null) {
1509  return variablesBuilder_.getMessageOrBuilderList();
1510  } else {
1511  return java.util.Collections.unmodifiableList(variables_);
1512  }
1513  }
1522  return getVariablesFieldBuilder().addBuilder(
1524  }
1533  int index) {
1534  return getVariablesFieldBuilder().addBuilder(
1536  }
1544  public java.util.List<com.google.ortools.sat.IntegerVariableProto.Builder>
1546  return getVariablesFieldBuilder().getBuilderList();
1547  }
1548  private com.google.protobuf.RepeatedFieldBuilderV3<
1550  getVariablesFieldBuilder() {
1551  if (variablesBuilder_ == null) {
1552  variablesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1554  variables_,
1555  ((bitField0_ & 0x00000001) != 0),
1556  getParentForChildren(),
1557  isClean());
1558  variables_ = null;
1559  }
1560  return variablesBuilder_;
1561  }
1562 
1563  private java.util.List<com.google.ortools.sat.ConstraintProto> constraints_ =
1564  java.util.Collections.emptyList();
1565  private void ensureConstraintsIsMutable() {
1566  if (!((bitField0_ & 0x00000002) != 0)) {
1567  constraints_ = new java.util.ArrayList<com.google.ortools.sat.ConstraintProto>(constraints_);
1568  bitField0_ |= 0x00000002;
1569  }
1570  }
1571 
1572  private com.google.protobuf.RepeatedFieldBuilderV3<
1574 
1579  if (constraintsBuilder_ == null) {
1580  return java.util.Collections.unmodifiableList(constraints_);
1581  } else {
1582  return constraintsBuilder_.getMessageList();
1583  }
1584  }
1588  public int getConstraintsCount() {
1589  if (constraintsBuilder_ == null) {
1590  return constraints_.size();
1591  } else {
1592  return constraintsBuilder_.getCount();
1593  }
1594  }
1599  if (constraintsBuilder_ == null) {
1600  return constraints_.get(index);
1601  } else {
1602  return constraintsBuilder_.getMessage(index);
1603  }
1604  }
1609  int index, com.google.ortools.sat.ConstraintProto value) {
1610  if (constraintsBuilder_ == null) {
1611  if (value == null) {
1612  throw new NullPointerException();
1613  }
1614  ensureConstraintsIsMutable();
1615  constraints_.set(index, value);
1616  onChanged();
1617  } else {
1618  constraintsBuilder_.setMessage(index, value);
1619  }
1620  return this;
1621  }
1626  int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1627  if (constraintsBuilder_ == null) {
1628  ensureConstraintsIsMutable();
1629  constraints_.set(index, builderForValue.build());
1630  onChanged();
1631  } else {
1632  constraintsBuilder_.setMessage(index, builderForValue.build());
1633  }
1634  return this;
1635  }
1640  if (constraintsBuilder_ == null) {
1641  if (value == null) {
1642  throw new NullPointerException();
1643  }
1644  ensureConstraintsIsMutable();
1645  constraints_.add(value);
1646  onChanged();
1647  } else {
1648  constraintsBuilder_.addMessage(value);
1649  }
1650  return this;
1651  }
1656  int index, com.google.ortools.sat.ConstraintProto value) {
1657  if (constraintsBuilder_ == null) {
1658  if (value == null) {
1659  throw new NullPointerException();
1660  }
1661  ensureConstraintsIsMutable();
1662  constraints_.add(index, value);
1663  onChanged();
1664  } else {
1665  constraintsBuilder_.addMessage(index, value);
1666  }
1667  return this;
1668  }
1673  com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1674  if (constraintsBuilder_ == null) {
1675  ensureConstraintsIsMutable();
1676  constraints_.add(builderForValue.build());
1677  onChanged();
1678  } else {
1679  constraintsBuilder_.addMessage(builderForValue.build());
1680  }
1681  return this;
1682  }
1687  int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1688  if (constraintsBuilder_ == null) {
1689  ensureConstraintsIsMutable();
1690  constraints_.add(index, builderForValue.build());
1691  onChanged();
1692  } else {
1693  constraintsBuilder_.addMessage(index, builderForValue.build());
1694  }
1695  return this;
1696  }
1701  java.lang.Iterable<? extends com.google.ortools.sat.ConstraintProto> values) {
1702  if (constraintsBuilder_ == null) {
1703  ensureConstraintsIsMutable();
1704  com.google.protobuf.AbstractMessageLite.Builder.addAll(
1705  values, constraints_);
1706  onChanged();
1707  } else {
1708  constraintsBuilder_.addAllMessages(values);
1709  }
1710  return this;
1711  }
1716  if (constraintsBuilder_ == null) {
1717  constraints_ = java.util.Collections.emptyList();
1718  bitField0_ = (bitField0_ & ~0x00000002);
1719  onChanged();
1720  } else {
1721  constraintsBuilder_.clear();
1722  }
1723  return this;
1724  }
1728  public Builder removeConstraints(int index) {
1729  if (constraintsBuilder_ == null) {
1730  ensureConstraintsIsMutable();
1731  constraints_.remove(index);
1732  onChanged();
1733  } else {
1734  constraintsBuilder_.remove(index);
1735  }
1736  return this;
1737  }
1742  int index) {
1743  return getConstraintsFieldBuilder().getBuilder(index);
1744  }
1749  int index) {
1750  if (constraintsBuilder_ == null) {
1751  return constraints_.get(index); } else {
1752  return constraintsBuilder_.getMessageOrBuilder(index);
1753  }
1754  }
1758  public java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder>
1760  if (constraintsBuilder_ != null) {
1761  return constraintsBuilder_.getMessageOrBuilderList();
1762  } else {
1763  return java.util.Collections.unmodifiableList(constraints_);
1764  }
1765  }
1770  return getConstraintsFieldBuilder().addBuilder(
1772  }
1777  int index) {
1778  return getConstraintsFieldBuilder().addBuilder(
1780  }
1784  public java.util.List<com.google.ortools.sat.ConstraintProto.Builder>
1786  return getConstraintsFieldBuilder().getBuilderList();
1787  }
1788  private com.google.protobuf.RepeatedFieldBuilderV3<
1790  getConstraintsFieldBuilder() {
1791  if (constraintsBuilder_ == null) {
1792  constraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1794  constraints_,
1795  ((bitField0_ & 0x00000002) != 0),
1796  getParentForChildren(),
1797  isClean());
1798  constraints_ = null;
1799  }
1800  return constraintsBuilder_;
1801  }
1802 
1803  private com.google.ortools.sat.CpObjectiveProto objective_;
1804  private com.google.protobuf.SingleFieldBuilderV3<
1814  public boolean hasObjective() {
1815  return objectiveBuilder_ != null || objective_ != null;
1816  }
1826  if (objectiveBuilder_ == null) {
1827  return objective_ == null ? com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
1828  } else {
1829  return objectiveBuilder_.getMessage();
1830  }
1831  }
1840  if (objectiveBuilder_ == null) {
1841  if (value == null) {
1842  throw new NullPointerException();
1843  }
1844  objective_ = value;
1845  onChanged();
1846  } else {
1847  objectiveBuilder_.setMessage(value);
1848  }
1849 
1850  return this;
1851  }
1860  com.google.ortools.sat.CpObjectiveProto.Builder builderForValue) {
1861  if (objectiveBuilder_ == null) {
1862  objective_ = builderForValue.build();
1863  onChanged();
1864  } else {
1865  objectiveBuilder_.setMessage(builderForValue.build());
1866  }
1867 
1868  return this;
1869  }
1878  if (objectiveBuilder_ == null) {
1879  if (objective_ != null) {
1880  objective_ =
1882  } else {
1883  objective_ = value;
1884  }
1885  onChanged();
1886  } else {
1887  objectiveBuilder_.mergeFrom(value);
1888  }
1889 
1890  return this;
1891  }
1900  if (objectiveBuilder_ == null) {
1901  objective_ = null;
1902  onChanged();
1903  } else {
1904  objective_ = null;
1905  objectiveBuilder_ = null;
1906  }
1907 
1908  return this;
1909  }
1918 
1919  onChanged();
1920  return getObjectiveFieldBuilder().getBuilder();
1921  }
1930  if (objectiveBuilder_ != null) {
1931  return objectiveBuilder_.getMessageOrBuilder();
1932  } else {
1933  return objective_ == null ?
1935  }
1936  }
1944  private com.google.protobuf.SingleFieldBuilderV3<
1946  getObjectiveFieldBuilder() {
1947  if (objectiveBuilder_ == null) {
1948  objectiveBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
1950  getObjective(),
1951  getParentForChildren(),
1952  isClean());
1953  objective_ = null;
1954  }
1955  return objectiveBuilder_;
1956  }
1957 
1958  private java.util.List<com.google.ortools.sat.DecisionStrategyProto> searchStrategy_ =
1959  java.util.Collections.emptyList();
1960  private void ensureSearchStrategyIsMutable() {
1961  if (!((bitField0_ & 0x00000004) != 0)) {
1962  searchStrategy_ = new java.util.ArrayList<com.google.ortools.sat.DecisionStrategyProto>(searchStrategy_);
1963  bitField0_ |= 0x00000004;
1964  }
1965  }
1966 
1967  private com.google.protobuf.RepeatedFieldBuilderV3<
1969 
1986  if (searchStrategyBuilder_ == null) {
1987  return java.util.Collections.unmodifiableList(searchStrategy_);
1988  } else {
1989  return searchStrategyBuilder_.getMessageList();
1990  }
1991  }
2007  public int getSearchStrategyCount() {
2008  if (searchStrategyBuilder_ == null) {
2009  return searchStrategy_.size();
2010  } else {
2011  return searchStrategyBuilder_.getCount();
2012  }
2013  }
2030  if (searchStrategyBuilder_ == null) {
2031  return searchStrategy_.get(index);
2032  } else {
2033  return searchStrategyBuilder_.getMessage(index);
2034  }
2035  }
2052  int index, com.google.ortools.sat.DecisionStrategyProto value) {
2053  if (searchStrategyBuilder_ == null) {
2054  if (value == null) {
2055  throw new NullPointerException();
2056  }
2057  ensureSearchStrategyIsMutable();
2058  searchStrategy_.set(index, value);
2059  onChanged();
2060  } else {
2061  searchStrategyBuilder_.setMessage(index, value);
2062  }
2063  return this;
2064  }
2081  int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
2082  if (searchStrategyBuilder_ == null) {
2083  ensureSearchStrategyIsMutable();
2084  searchStrategy_.set(index, builderForValue.build());
2085  onChanged();
2086  } else {
2087  searchStrategyBuilder_.setMessage(index, builderForValue.build());
2088  }
2089  return this;
2090  }
2107  if (searchStrategyBuilder_ == null) {
2108  if (value == null) {
2109  throw new NullPointerException();
2110  }
2111  ensureSearchStrategyIsMutable();
2112  searchStrategy_.add(value);
2113  onChanged();
2114  } else {
2115  searchStrategyBuilder_.addMessage(value);
2116  }
2117  return this;
2118  }
2135  int index, com.google.ortools.sat.DecisionStrategyProto value) {
2136  if (searchStrategyBuilder_ == null) {
2137  if (value == null) {
2138  throw new NullPointerException();
2139  }
2140  ensureSearchStrategyIsMutable();
2141  searchStrategy_.add(index, value);
2142  onChanged();
2143  } else {
2144  searchStrategyBuilder_.addMessage(index, value);
2145  }
2146  return this;
2147  }
2164  com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
2165  if (searchStrategyBuilder_ == null) {
2166  ensureSearchStrategyIsMutable();
2167  searchStrategy_.add(builderForValue.build());
2168  onChanged();
2169  } else {
2170  searchStrategyBuilder_.addMessage(builderForValue.build());
2171  }
2172  return this;
2173  }
2190  int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
2191  if (searchStrategyBuilder_ == null) {
2192  ensureSearchStrategyIsMutable();
2193  searchStrategy_.add(index, builderForValue.build());
2194  onChanged();
2195  } else {
2196  searchStrategyBuilder_.addMessage(index, builderForValue.build());
2197  }
2198  return this;
2199  }
2216  java.lang.Iterable<? extends com.google.ortools.sat.DecisionStrategyProto> values) {
2217  if (searchStrategyBuilder_ == null) {
2218  ensureSearchStrategyIsMutable();
2219  com.google.protobuf.AbstractMessageLite.Builder.addAll(
2220  values, searchStrategy_);
2221  onChanged();
2222  } else {
2223  searchStrategyBuilder_.addAllMessages(values);
2224  }
2225  return this;
2226  }
2243  if (searchStrategyBuilder_ == null) {
2244  searchStrategy_ = java.util.Collections.emptyList();
2245  bitField0_ = (bitField0_ & ~0x00000004);
2246  onChanged();
2247  } else {
2248  searchStrategyBuilder_.clear();
2249  }
2250  return this;
2251  }
2267  public Builder removeSearchStrategy(int index) {
2268  if (searchStrategyBuilder_ == null) {
2269  ensureSearchStrategyIsMutable();
2270  searchStrategy_.remove(index);
2271  onChanged();
2272  } else {
2273  searchStrategyBuilder_.remove(index);
2274  }
2275  return this;
2276  }
2293  int index) {
2294  return getSearchStrategyFieldBuilder().getBuilder(index);
2295  }
2312  int index) {
2313  if (searchStrategyBuilder_ == null) {
2314  return searchStrategy_.get(index); } else {
2315  return searchStrategyBuilder_.getMessageOrBuilder(index);
2316  }
2317  }
2333  public java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
2335  if (searchStrategyBuilder_ != null) {
2336  return searchStrategyBuilder_.getMessageOrBuilderList();
2337  } else {
2338  return java.util.Collections.unmodifiableList(searchStrategy_);
2339  }
2340  }
2357  return getSearchStrategyFieldBuilder().addBuilder(
2359  }
2376  int index) {
2377  return getSearchStrategyFieldBuilder().addBuilder(
2379  }
2395  public java.util.List<com.google.ortools.sat.DecisionStrategyProto.Builder>
2397  return getSearchStrategyFieldBuilder().getBuilderList();
2398  }
2399  private com.google.protobuf.RepeatedFieldBuilderV3<
2401  getSearchStrategyFieldBuilder() {
2402  if (searchStrategyBuilder_ == null) {
2403  searchStrategyBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
2405  searchStrategy_,
2406  ((bitField0_ & 0x00000004) != 0),
2407  getParentForChildren(),
2408  isClean());
2409  searchStrategy_ = null;
2410  }
2411  return searchStrategyBuilder_;
2412  }
2413 
2414  private com.google.ortools.sat.PartialVariableAssignment solutionHint_;
2415  private com.google.protobuf.SingleFieldBuilderV3<
2433  public boolean hasSolutionHint() {
2434  return solutionHintBuilder_ != null || solutionHint_ != null;
2435  }
2453  if (solutionHintBuilder_ == null) {
2454  return solutionHint_ == null ? com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
2455  } else {
2456  return solutionHintBuilder_.getMessage();
2457  }
2458  }
2475  if (solutionHintBuilder_ == null) {
2476  if (value == null) {
2477  throw new NullPointerException();
2478  }
2479  solutionHint_ = value;
2480  onChanged();
2481  } else {
2482  solutionHintBuilder_.setMessage(value);
2483  }
2484 
2485  return this;
2486  }
2504  if (solutionHintBuilder_ == null) {
2505  solutionHint_ = builderForValue.build();
2506  onChanged();
2507  } else {
2508  solutionHintBuilder_.setMessage(builderForValue.build());
2509  }
2510 
2511  return this;
2512  }
2529  if (solutionHintBuilder_ == null) {
2530  if (solutionHint_ != null) {
2531  solutionHint_ =
2533  } else {
2534  solutionHint_ = value;
2535  }
2536  onChanged();
2537  } else {
2538  solutionHintBuilder_.mergeFrom(value);
2539  }
2540 
2541  return this;
2542  }
2559  if (solutionHintBuilder_ == null) {
2560  solutionHint_ = null;
2561  onChanged();
2562  } else {
2563  solutionHint_ = null;
2564  solutionHintBuilder_ = null;
2565  }
2566 
2567  return this;
2568  }
2585 
2586  onChanged();
2587  return getSolutionHintFieldBuilder().getBuilder();
2588  }
2605  if (solutionHintBuilder_ != null) {
2606  return solutionHintBuilder_.getMessageOrBuilder();
2607  } else {
2608  return solutionHint_ == null ?
2610  }
2611  }
2627  private com.google.protobuf.SingleFieldBuilderV3<
2629  getSolutionHintFieldBuilder() {
2630  if (solutionHintBuilder_ == null) {
2631  solutionHintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
2633  getSolutionHint(),
2634  getParentForChildren(),
2635  isClean());
2636  solutionHint_ = null;
2637  }
2638  return solutionHintBuilder_;
2639  }
2640 
2641  private com.google.protobuf.Internal.IntList assumptions_ = emptyIntList();
2642  private void ensureAssumptionsIsMutable() {
2643  if (!((bitField0_ & 0x00000008) != 0)) {
2644  assumptions_ = mutableCopy(assumptions_);
2645  bitField0_ |= 0x00000008;
2646  }
2647  }
2666  public java.util.List<java.lang.Integer>
2668  return ((bitField0_ & 0x00000008) != 0) ?
2669  java.util.Collections.unmodifiableList(assumptions_) : assumptions_;
2670  }
2689  public int getAssumptionsCount() {
2690  return assumptions_.size();
2691  }
2711  public int getAssumptions(int index) {
2712  return assumptions_.getInt(index);
2713  }
2735  int index, int value) {
2736  ensureAssumptionsIsMutable();
2737  assumptions_.setInt(index, value);
2738  onChanged();
2739  return this;
2740  }
2760  public Builder addAssumptions(int value) {
2761  ensureAssumptionsIsMutable();
2762  assumptions_.addInt(value);
2763  onChanged();
2764  return this;
2765  }
2786  java.lang.Iterable<? extends java.lang.Integer> values) {
2787  ensureAssumptionsIsMutable();
2788  com.google.protobuf.AbstractMessageLite.Builder.addAll(
2789  values, assumptions_);
2790  onChanged();
2791  return this;
2792  }
2812  assumptions_ = emptyIntList();
2813  bitField0_ = (bitField0_ & ~0x00000008);
2814  onChanged();
2815  return this;
2816  }
2817  @java.lang.Override
2819  final com.google.protobuf.UnknownFieldSet unknownFields) {
2820  return super.setUnknownFields(unknownFields);
2821  }
2822 
2823  @java.lang.Override
2825  final com.google.protobuf.UnknownFieldSet unknownFields) {
2826  return super.mergeUnknownFields(unknownFields);
2827  }
2828 
2829 
2830  // @@protoc_insertion_point(builder_scope:operations_research.sat.CpModelProto)
2831  }
2832 
2833  // @@protoc_insertion_point(class_scope:operations_research.sat.CpModelProto)
2834  private static final com.google.ortools.sat.CpModelProto DEFAULT_INSTANCE;
2835  static {
2836  DEFAULT_INSTANCE = new com.google.ortools.sat.CpModelProto();
2837  }
2838 
2840  return DEFAULT_INSTANCE;
2841  }
2842 
2843  private static final com.google.protobuf.Parser<CpModelProto>
2844  PARSER = new com.google.protobuf.AbstractParser<CpModelProto>() {
2845  @java.lang.Override
2846  public CpModelProto parsePartialFrom(
2847  com.google.protobuf.CodedInputStream input,
2848  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2849  throws com.google.protobuf.InvalidProtocolBufferException {
2850  return new CpModelProto(input, extensionRegistry);
2851  }
2852  };
2853 
2854  public static com.google.protobuf.Parser<CpModelProto> parser() {
2855  return PARSER;
2856  }
2857 
2858  @java.lang.Override
2859  public com.google.protobuf.Parser<CpModelProto> getParserForType() {
2860  return PARSER;
2861  }
2862 
2863  @java.lang.Override
2865  return DEFAULT_INSTANCE;
2866  }
2867 
2868 }
2869 
Builder clearConstraints()
repeated .operations_research.sat.ConstraintProto constraints = 3;
boolean hasSolutionHint()
static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input)
Builder setObjective(com.google.ortools.sat.CpObjectiveProto value)
static Builder newBuilder()
.lang.Override boolean equals(final java.lang.Object obj)
static com.google.protobuf.Parser< ConstraintProto > parser()
Builder addConstraints(int index, com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder setSolutionHint(com.google.ortools.sat.PartialVariableAssignment value)
.lang.Override final com.google.protobuf.UnknownFieldSet getUnknownFields()
Builder setAssumptions(int index, int value)
com.google.ortools.sat.CpObjectiveProto getObjective()
com.google.ortools.sat.CpObjectiveProto.Builder getObjectiveBuilder()
com.google.ortools.sat.IntegerVariableProto.Builder getVariablesBuilder(int index)
Builder addVariables(com.google.ortools.sat.IntegerVariableProto value)
com.google.ortools.sat.IntegerVariableProto.Builder addVariablesBuilder(int index)
.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
static final int VARIABLES_FIELD_NUMBER
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
Builder setSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto value)
.lang.Override Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
Builder setObjective(com.google.ortools.sat.CpObjectiveProto.Builder builderForValue)
com.google.ortools.sat.ConstraintProto.Builder getConstraintsBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.protobuf.Parser< CpObjectiveProto > parser()
.lang.Override final boolean isInitialized()
Builder clearObjective()
static com.google.protobuf.Parser< IntegerVariableProto > parser()
int getConstraintsCount()
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.CpModelProto getDefaultInstance()
Builder mergeObjective(com.google.ortools.sat.CpObjectiveProto value)
Builder addConstraints(com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override com.google.ortools.sat.CpObjectiveProto buildPartial()
.lang.Override com.google.ortools.sat.CpModelProto getDefaultInstanceForType()
.lang.Override Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CpObjectiveProto getDefaultInstance()
Builder setConstraints(int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.CpModelProto parseFrom(byte[] data)
com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(int index)
.lang.Override int hashCode()
Builder mergeFrom(com.google.ortools.sat.CpModelProto other)
.lang.Override int hashCode()
Builder addVariables(int index, com.google.ortools.sat.IntegerVariableProto value)
static final int NAME_FIELD_NUMBER
com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(int index)
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override com.google.protobuf.Parser< CpModelProto > getParserForType()
com.google.ortools.sat.ConstraintProto.Builder addConstraintsBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override com.google.ortools.sat.PartialVariableAssignment buildPartial()
Builder clearName()
com.google.ortools.sat.IntegerVariableProto getVariables(int index)
Builder addAllAssumptions(java.lang.Iterable<? extends java.lang.Integer > values)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
java.util.List< com.google.ortools.sat.ConstraintProto > getConstraintsList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
int getAssumptionsCount()
com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(int index)
.lang.Override Builder toBuilder()
com.google.protobuf.ByteString getNameBytes()
com.google.ortools.sat.DecisionStrategyProto.Builder getSearchStrategyBuilder(int index)
int getSearchStrategyCount()
static com.google.ortools.sat.CpModelProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override Builder clear()
.lang.Override final boolean isInitialized()
.lang.Override int getSerializedSize()
com.google.ortools.sat.ConstraintProto.Builder addConstraintsBuilder()
repeated .operations_research.sat.ConstraintProto constraints = 3;
int getAssumptionsCount()
java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder > getSearchStrategyOrBuilderList()
boolean hasObjective()
Builder removeVariables(int index)
Builder mergeSolutionHint(com.google.ortools.sat.PartialVariableAssignment value)
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
java.util.List< com.google.ortools.sat.ConstraintProto.Builder > getConstraintsBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
static Builder newBuilder(com.google.ortools.sat.CpModelProto prototype)
java.util.List< java.lang.Integer > getAssumptionsList()
static com.google.protobuf.Parser< CpModelProto > parser()
static com.google.ortools.sat.PartialVariableAssignment getDefaultInstance()
com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addAssumptions(int value)
int getVariablesCount()
int getAssumptions(int index)
Builder setVariables(int index, com.google.ortools.sat.IntegerVariableProto value)
com.google.protobuf.ByteString getNameBytes()
java.util.List< com.google.ortools.sat.IntegerVariableProto > getVariablesList()
.lang.Override Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
static com.google.ortools.sat.DecisionStrategyProto getDefaultInstance()
int getAssumptions(int index)
Builder setConstraints(int index, com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
java.util.List< com.google.ortools.sat.IntegerVariableProto.Builder > getVariablesBuilderList()
com.google.ortools.sat.PartialVariableAssignment.Builder getSolutionHintBuilder()
.lang.Override Builder toBuilder()
java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder > getSearchStrategyOrBuilderList()
java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder > getConstraintsOrBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addVariables(int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
.lang.Override Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder > getVariablesOrBuilderList()
.lang.Override com.google.ortools.sat.CpModelProto build()
.lang.Override final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
com.google.ortools.sat.DecisionStrategyProto.Builder addSearchStrategyBuilder(int index)
static com.google.protobuf.Parser< DecisionStrategyProto > parser()
java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder > getConstraintsOrBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder addConstraints(int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder clearVariables()
static com.google.protobuf.Parser< PartialVariableAssignment > parser()
com.google.ortools.sat.DecisionStrategyProto.Builder addSearchStrategyBuilder()
.lang.Override Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
.lang.Override java.lang.Object newInstance(UnusedPrivateParameter unused)
Builder addSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
int getVariablesCount()
boolean hasSolutionHint()
java.util.List< java.lang.Integer > getAssumptionsList()
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
.lang.Override boolean equals(final java.lang.Object obj)
int getConstraintsCount()
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.CpModelProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder clearAssumptions()
Builder addSearchStrategy(com.google.ortools.sat.DecisionStrategyProto value)
.lang.Override com.google.ortools.sat.CpModelProto buildPartial()
Builder clearSolutionHint()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.sat.DecisionStrategyProto getSearchStrategy(int index)
java.lang.String getName()
boolean hasObjective()
.lang.Override boolean equals(final java.lang.Object obj)
Builder removeConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static final int SOLUTION_HINT_FIELD_NUMBER
com.google.ortools.sat.ConstraintProto getConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.ConstraintProto getDefaultInstance()
.lang.Override com.google.ortools.sat.CpModelProto getDefaultInstanceForType()
.lang.Override final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder()
java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder > getVariablesOrBuilderList()
.lang.Override Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
Builder setVariables(int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
static final int CONSTRAINTS_FIELD_NUMBER
Builder setName(java.lang.String value)
static com.google.ortools.sat.CpModelProto parseFrom(java.nio.ByteBuffer data)
Builder addSearchStrategy(com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addVariables(com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Builder addAllConstraints(java.lang.Iterable<? extends com.google.ortools.sat.ConstraintProto > values)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder removeSearchStrategy(int index)
Builder addAllSearchStrategy(java.lang.Iterable<? extends com.google.ortools.sat.DecisionStrategyProto > values)
.lang.Override int hashCode()
java.util.List< com.google.ortools.sat.DecisionStrategyProto > getSearchStrategyList()
com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(int index)
int getSearchStrategyCount()
Builder setNameBytes(com.google.protobuf.ByteString value)
static Builder newBuilder()
com.google.ortools.sat.IntegerVariableProto getVariables(int index)
static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input)
static final int OBJECTIVE_FIELD_NUMBER
java.util.List< com.google.ortools.sat.ConstraintProto > getConstraintsList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder()
.lang.Override Builder clone()
.lang.Override Builder toBuilder()
java.util.List< com.google.ortools.sat.IntegerVariableProto > getVariablesList()
com.google.ortools.sat.IntegerVariableProto.Builder addVariablesBuilder()
static com.google.ortools.sat.IntegerVariableProto getDefaultInstance()
static final int ASSUMPTIONS_FIELD_NUMBER
java.util.List< com.google.ortools.sat.DecisionStrategyProto.Builder > getSearchStrategyBuilderList()
com.google.ortools.sat.PartialVariableAssignment getSolutionHint()
static final int SEARCH_STRATEGY_FIELD_NUMBER
.lang.Override Builder newBuilderForType()
com.google.ortools.sat.PartialVariableAssignment getSolutionHint()
static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static Builder newBuilder()
.lang.Override void writeTo(com.google.protobuf.CodedOutputStream output)
Builder setSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
java.lang.String getName()
com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder()
Builder addConstraints(com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto value)
Builder setSolutionHint(com.google.ortools.sat.PartialVariableAssignment.Builder builderForValue)
Builder clearSearchStrategy()
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.CodedInputStream input)
com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder()
com.google.ortools.sat.DecisionStrategyProto getSearchStrategy(int index)
java.util.List< com.google.ortools.sat.DecisionStrategyProto > getSearchStrategyList()
com.google.ortools.sat.ConstraintProto getConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addAllVariables(java.lang.Iterable<? extends com.google.ortools.sat.IntegerVariableProto > values)
com.google.ortools.sat.CpObjectiveProto getObjective()