OR-Tools  7.1
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  }
28 
29  @java.lang.Override
30  public final com.google.protobuf.UnknownFieldSet
32  return this.unknownFields;
33  }
34  private CpModelProto(
35  com.google.protobuf.CodedInputStream input,
36  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
37  throws com.google.protobuf.InvalidProtocolBufferException {
38  this();
39  if (extensionRegistry == null) {
40  throw new java.lang.NullPointerException();
41  }
42  int mutable_bitField0_ = 0;
43  com.google.protobuf.UnknownFieldSet.Builder unknownFields =
44  com.google.protobuf.UnknownFieldSet.newBuilder();
45  try {
46  boolean done = false;
47  while (!done) {
48  int tag = input.readTag();
49  switch (tag) {
50  case 0:
51  done = true;
52  break;
53  case 10: {
54  java.lang.String s = input.readStringRequireUtf8();
55 
56  name_ = s;
57  break;
58  }
59  case 18: {
60  if (!((mutable_bitField0_ & 0x00000002) != 0)) {
61  variables_ = new java.util.ArrayList<com.google.ortools.sat.IntegerVariableProto>();
62  mutable_bitField0_ |= 0x00000002;
63  }
64  variables_.add(
65  input.readMessage(com.google.ortools.sat.IntegerVariableProto.parser(), extensionRegistry));
66  break;
67  }
68  case 26: {
69  if (!((mutable_bitField0_ & 0x00000004) != 0)) {
70  constraints_ = new java.util.ArrayList<com.google.ortools.sat.ConstraintProto>();
71  mutable_bitField0_ |= 0x00000004;
72  }
73  constraints_.add(
74  input.readMessage(com.google.ortools.sat.ConstraintProto.parser(), extensionRegistry));
75  break;
76  }
77  case 34: {
78  com.google.ortools.sat.CpObjectiveProto.Builder subBuilder = null;
79  if (objective_ != null) {
80  subBuilder = objective_.toBuilder();
81  }
82  objective_ = input.readMessage(com.google.ortools.sat.CpObjectiveProto.parser(), extensionRegistry);
83  if (subBuilder != null) {
84  subBuilder.mergeFrom(objective_);
85  objective_ = subBuilder.buildPartial();
86  }
87 
88  break;
89  }
90  case 42: {
91  if (!((mutable_bitField0_ & 0x00000010) != 0)) {
92  searchStrategy_ = new java.util.ArrayList<com.google.ortools.sat.DecisionStrategyProto>();
93  mutable_bitField0_ |= 0x00000010;
94  }
95  searchStrategy_.add(
96  input.readMessage(com.google.ortools.sat.DecisionStrategyProto.parser(), extensionRegistry));
97  break;
98  }
99  case 50: {
101  if (solutionHint_ != null) {
102  subBuilder = solutionHint_.toBuilder();
103  }
104  solutionHint_ = input.readMessage(com.google.ortools.sat.PartialVariableAssignment.parser(), extensionRegistry);
105  if (subBuilder != null) {
106  subBuilder.mergeFrom(solutionHint_);
107  solutionHint_ = subBuilder.buildPartial();
108  }
109 
110  break;
111  }
112  default: {
113  if (!parseUnknownField(
114  input, unknownFields, extensionRegistry, tag)) {
115  done = true;
116  }
117  break;
118  }
119  }
120  }
121  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
122  throw e.setUnfinishedMessage(this);
123  } catch (java.io.IOException e) {
124  throw new com.google.protobuf.InvalidProtocolBufferException(
125  e).setUnfinishedMessage(this);
126  } finally {
127  if (((mutable_bitField0_ & 0x00000002) != 0)) {
128  variables_ = java.util.Collections.unmodifiableList(variables_);
129  }
130  if (((mutable_bitField0_ & 0x00000004) != 0)) {
131  constraints_ = java.util.Collections.unmodifiableList(constraints_);
132  }
133  if (((mutable_bitField0_ & 0x00000010) != 0)) {
134  searchStrategy_ = java.util.Collections.unmodifiableList(searchStrategy_);
135  }
136  this.unknownFields = unknownFields.build();
137  makeExtensionsImmutable();
138  }
139  }
140  public static final com.google.protobuf.Descriptors.Descriptor
142  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
143  }
144 
145  @java.lang.Override
146  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
148  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_fieldAccessorTable
149  .ensureFieldAccessorsInitialized(
151  }
152 
153  private int bitField0_;
154  public static final int NAME_FIELD_NUMBER = 1;
155  private volatile java.lang.Object name_;
163  public java.lang.String getName() {
164  java.lang.Object ref = name_;
165  if (ref instanceof java.lang.String) {
166  return (java.lang.String) ref;
167  } else {
168  com.google.protobuf.ByteString bs =
169  (com.google.protobuf.ByteString) ref;
170  java.lang.String s = bs.toStringUtf8();
171  name_ = s;
172  return s;
173  }
174  }
182  public com.google.protobuf.ByteString
184  java.lang.Object ref = name_;
185  if (ref instanceof java.lang.String) {
186  com.google.protobuf.ByteString b =
187  com.google.protobuf.ByteString.copyFromUtf8(
188  (java.lang.String) ref);
189  name_ = b;
190  return b;
191  } else {
192  return (com.google.protobuf.ByteString) ref;
193  }
194  }
195 
196  public static final int VARIABLES_FIELD_NUMBER = 2;
197  private java.util.List<com.google.ortools.sat.IntegerVariableProto> variables_;
206  return variables_;
207  }
215  public java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder>
217  return variables_;
218  }
226  public int getVariablesCount() {
227  return variables_.size();
228  }
237  return variables_.get(index);
238  }
247  int index) {
248  return variables_.get(index);
249  }
250 
251  public static final int CONSTRAINTS_FIELD_NUMBER = 3;
252  private java.util.List<com.google.ortools.sat.ConstraintProto> constraints_;
257  return constraints_;
258  }
262  public java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder>
264  return constraints_;
265  }
269  public int getConstraintsCount() {
270  return constraints_.size();
271  }
276  return constraints_.get(index);
277  }
282  int index) {
283  return constraints_.get(index);
284  }
285 
286  public static final int OBJECTIVE_FIELD_NUMBER = 4;
287  private com.google.ortools.sat.CpObjectiveProto objective_;
295  public boolean hasObjective() {
296  return objective_ != null;
297  }
306  return objective_ == null ? com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
307  }
316  return getObjective();
317  }
318 
319  public static final int SEARCH_STRATEGY_FIELD_NUMBER = 5;
320  private java.util.List<com.google.ortools.sat.DecisionStrategyProto> searchStrategy_;
337  return searchStrategy_;
338  }
354  public java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
356  return searchStrategy_;
357  }
373  public int getSearchStrategyCount() {
374  return searchStrategy_.size();
375  }
392  return searchStrategy_.get(index);
393  }
410  int index) {
411  return searchStrategy_.get(index);
412  }
413 
414  public static final int SOLUTION_HINT_FIELD_NUMBER = 6;
415  private com.google.ortools.sat.PartialVariableAssignment solutionHint_;
431  public boolean hasSolutionHint() {
432  return solutionHint_ != null;
433  }
450  return solutionHint_ == null ? com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
451  }
468  return getSolutionHint();
469  }
470 
471  private byte memoizedIsInitialized = -1;
472  @java.lang.Override
473  public final boolean isInitialized() {
474  byte isInitialized = memoizedIsInitialized;
475  if (isInitialized == 1) return true;
476  if (isInitialized == 0) return false;
477 
478  memoizedIsInitialized = 1;
479  return true;
480  }
481 
482  @java.lang.Override
483  public void writeTo(com.google.protobuf.CodedOutputStream output)
484  throws java.io.IOException {
485  if (!getNameBytes().isEmpty()) {
486  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
487  }
488  for (int i = 0; i < variables_.size(); i++) {
489  output.writeMessage(2, variables_.get(i));
490  }
491  for (int i = 0; i < constraints_.size(); i++) {
492  output.writeMessage(3, constraints_.get(i));
493  }
494  if (objective_ != null) {
495  output.writeMessage(4, getObjective());
496  }
497  for (int i = 0; i < searchStrategy_.size(); i++) {
498  output.writeMessage(5, searchStrategy_.get(i));
499  }
500  if (solutionHint_ != null) {
501  output.writeMessage(6, getSolutionHint());
502  }
503  unknownFields.writeTo(output);
504  }
505 
506  @java.lang.Override
507  public int getSerializedSize() {
508  int size = memoizedSize;
509  if (size != -1) return size;
510 
511  size = 0;
512  if (!getNameBytes().isEmpty()) {
513  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
514  }
515  for (int i = 0; i < variables_.size(); i++) {
516  size += com.google.protobuf.CodedOutputStream
517  .computeMessageSize(2, variables_.get(i));
518  }
519  for (int i = 0; i < constraints_.size(); i++) {
520  size += com.google.protobuf.CodedOutputStream
521  .computeMessageSize(3, constraints_.get(i));
522  }
523  if (objective_ != null) {
524  size += com.google.protobuf.CodedOutputStream
525  .computeMessageSize(4, getObjective());
526  }
527  for (int i = 0; i < searchStrategy_.size(); i++) {
528  size += com.google.protobuf.CodedOutputStream
529  .computeMessageSize(5, searchStrategy_.get(i));
530  }
531  if (solutionHint_ != null) {
532  size += com.google.protobuf.CodedOutputStream
533  .computeMessageSize(6, getSolutionHint());
534  }
535  size += unknownFields.getSerializedSize();
536  memoizedSize = size;
537  return size;
538  }
539 
540  @java.lang.Override
541  public boolean equals(final java.lang.Object obj) {
542  if (obj == this) {
543  return true;
544  }
545  if (!(obj instanceof com.google.ortools.sat.CpModelProto)) {
546  return super.equals(obj);
547  }
549 
550  if (!getName()
551  .equals(other.getName())) return false;
552  if (!getVariablesList()
553  .equals(other.getVariablesList())) return false;
554  if (!getConstraintsList()
555  .equals(other.getConstraintsList())) return false;
556  if (hasObjective() != other.hasObjective()) return false;
557  if (hasObjective()) {
558  if (!getObjective()
559  .equals(other.getObjective())) return false;
560  }
561  if (!getSearchStrategyList()
562  .equals(other.getSearchStrategyList())) return false;
563  if (hasSolutionHint() != other.hasSolutionHint()) return false;
564  if (hasSolutionHint()) {
565  if (!getSolutionHint()
566  .equals(other.getSolutionHint())) return false;
567  }
568  if (!unknownFields.equals(other.unknownFields)) return false;
569  return true;
570  }
571 
572  @java.lang.Override
573  public int hashCode() {
574  if (memoizedHashCode != 0) {
575  return memoizedHashCode;
576  }
577  int hash = 41;
578  hash = (19 * hash) + getDescriptor().hashCode();
579  hash = (37 * hash) + NAME_FIELD_NUMBER;
580  hash = (53 * hash) + getName().hashCode();
581  if (getVariablesCount() > 0) {
582  hash = (37 * hash) + VARIABLES_FIELD_NUMBER;
583  hash = (53 * hash) + getVariablesList().hashCode();
584  }
585  if (getConstraintsCount() > 0) {
586  hash = (37 * hash) + CONSTRAINTS_FIELD_NUMBER;
587  hash = (53 * hash) + getConstraintsList().hashCode();
588  }
589  if (hasObjective()) {
590  hash = (37 * hash) + OBJECTIVE_FIELD_NUMBER;
591  hash = (53 * hash) + getObjective().hashCode();
592  }
593  if (getSearchStrategyCount() > 0) {
594  hash = (37 * hash) + SEARCH_STRATEGY_FIELD_NUMBER;
595  hash = (53 * hash) + getSearchStrategyList().hashCode();
596  }
597  if (hasSolutionHint()) {
598  hash = (37 * hash) + SOLUTION_HINT_FIELD_NUMBER;
599  hash = (53 * hash) + getSolutionHint().hashCode();
600  }
601  hash = (29 * hash) + unknownFields.hashCode();
602  memoizedHashCode = hash;
603  return hash;
604  }
605 
607  java.nio.ByteBuffer data)
608  throws com.google.protobuf.InvalidProtocolBufferException {
609  return PARSER.parseFrom(data);
610  }
612  java.nio.ByteBuffer data,
613  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
614  throws com.google.protobuf.InvalidProtocolBufferException {
615  return PARSER.parseFrom(data, extensionRegistry);
616  }
618  com.google.protobuf.ByteString data)
619  throws com.google.protobuf.InvalidProtocolBufferException {
620  return PARSER.parseFrom(data);
621  }
623  com.google.protobuf.ByteString data,
624  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
625  throws com.google.protobuf.InvalidProtocolBufferException {
626  return PARSER.parseFrom(data, extensionRegistry);
627  }
628  public static com.google.ortools.sat.CpModelProto parseFrom(byte[] data)
629  throws com.google.protobuf.InvalidProtocolBufferException {
630  return PARSER.parseFrom(data);
631  }
633  byte[] data,
634  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
635  throws com.google.protobuf.InvalidProtocolBufferException {
636  return PARSER.parseFrom(data, extensionRegistry);
637  }
638  public static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input)
639  throws java.io.IOException {
640  return com.google.protobuf.GeneratedMessageV3
641  .parseWithIOException(PARSER, input);
642  }
644  java.io.InputStream input,
645  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
646  throws java.io.IOException {
647  return com.google.protobuf.GeneratedMessageV3
648  .parseWithIOException(PARSER, input, extensionRegistry);
649  }
650  public static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input)
651  throws java.io.IOException {
652  return com.google.protobuf.GeneratedMessageV3
653  .parseDelimitedWithIOException(PARSER, input);
654  }
656  java.io.InputStream input,
657  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
658  throws java.io.IOException {
659  return com.google.protobuf.GeneratedMessageV3
660  .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
661  }
663  com.google.protobuf.CodedInputStream input)
664  throws java.io.IOException {
665  return com.google.protobuf.GeneratedMessageV3
666  .parseWithIOException(PARSER, input);
667  }
669  com.google.protobuf.CodedInputStream input,
670  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
671  throws java.io.IOException {
672  return com.google.protobuf.GeneratedMessageV3
673  .parseWithIOException(PARSER, input, extensionRegistry);
674  }
675 
676  @java.lang.Override
677  public Builder newBuilderForType() { return newBuilder(); }
678  public static Builder newBuilder() {
679  return DEFAULT_INSTANCE.toBuilder();
680  }
681  public static Builder newBuilder(com.google.ortools.sat.CpModelProto prototype) {
682  return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
683  }
684  @java.lang.Override
685  public Builder toBuilder() {
686  return this == DEFAULT_INSTANCE
687  ? new Builder() : new Builder().mergeFrom(this);
688  }
689 
690  @java.lang.Override
692  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
693  Builder builder = new Builder(parent);
694  return builder;
695  }
703  public static final class Builder extends
704  com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
705  // @@protoc_insertion_point(builder_implements:operations_research.sat.CpModelProto)
706  com.google.ortools.sat.CpModelProtoOrBuilder {
707  public static final com.google.protobuf.Descriptors.Descriptor
709  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
710  }
711 
712  @java.lang.Override
713  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
715  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_fieldAccessorTable
716  .ensureFieldAccessorsInitialized(
718  }
719 
720  // Construct using com.google.ortools.sat.CpModelProto.newBuilder()
721  private Builder() {
722  maybeForceBuilderInitialization();
723  }
724 
725  private Builder(
726  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
727  super(parent);
728  maybeForceBuilderInitialization();
729  }
730  private void maybeForceBuilderInitialization() {
731  if (com.google.protobuf.GeneratedMessageV3
732  .alwaysUseFieldBuilders) {
733  getVariablesFieldBuilder();
734  getConstraintsFieldBuilder();
735  getSearchStrategyFieldBuilder();
736  }
737  }
738  @java.lang.Override
739  public Builder clear() {
740  super.clear();
741  name_ = "";
742 
743  if (variablesBuilder_ == null) {
744  variables_ = java.util.Collections.emptyList();
745  bitField0_ = (bitField0_ & ~0x00000002);
746  } else {
747  variablesBuilder_.clear();
748  }
749  if (constraintsBuilder_ == null) {
750  constraints_ = java.util.Collections.emptyList();
751  bitField0_ = (bitField0_ & ~0x00000004);
752  } else {
753  constraintsBuilder_.clear();
754  }
755  if (objectiveBuilder_ == null) {
756  objective_ = null;
757  } else {
758  objective_ = null;
759  objectiveBuilder_ = null;
760  }
761  if (searchStrategyBuilder_ == null) {
762  searchStrategy_ = java.util.Collections.emptyList();
763  bitField0_ = (bitField0_ & ~0x00000010);
764  } else {
765  searchStrategyBuilder_.clear();
766  }
767  if (solutionHintBuilder_ == null) {
768  solutionHint_ = null;
769  } else {
770  solutionHint_ = null;
771  solutionHintBuilder_ = null;
772  }
773  return this;
774  }
775 
776  @java.lang.Override
777  public com.google.protobuf.Descriptors.Descriptor
779  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
780  }
781 
782  @java.lang.Override
785  }
786 
787  @java.lang.Override
790  if (!result.isInitialized()) {
791  throw newUninitializedMessageException(result);
792  }
793  return result;
794  }
795 
796  @java.lang.Override
799  int from_bitField0_ = bitField0_;
800  int to_bitField0_ = 0;
801  result.name_ = name_;
802  if (variablesBuilder_ == null) {
803  if (((bitField0_ & 0x00000002) != 0)) {
804  variables_ = java.util.Collections.unmodifiableList(variables_);
805  bitField0_ = (bitField0_ & ~0x00000002);
806  }
807  result.variables_ = variables_;
808  } else {
809  result.variables_ = variablesBuilder_.build();
810  }
811  if (constraintsBuilder_ == null) {
812  if (((bitField0_ & 0x00000004) != 0)) {
813  constraints_ = java.util.Collections.unmodifiableList(constraints_);
814  bitField0_ = (bitField0_ & ~0x00000004);
815  }
816  result.constraints_ = constraints_;
817  } else {
818  result.constraints_ = constraintsBuilder_.build();
819  }
820  if (objectiveBuilder_ == null) {
821  result.objective_ = objective_;
822  } else {
823  result.objective_ = objectiveBuilder_.build();
824  }
825  if (searchStrategyBuilder_ == null) {
826  if (((bitField0_ & 0x00000010) != 0)) {
827  searchStrategy_ = java.util.Collections.unmodifiableList(searchStrategy_);
828  bitField0_ = (bitField0_ & ~0x00000010);
829  }
830  result.searchStrategy_ = searchStrategy_;
831  } else {
832  result.searchStrategy_ = searchStrategyBuilder_.build();
833  }
834  if (solutionHintBuilder_ == null) {
835  result.solutionHint_ = solutionHint_;
836  } else {
837  result.solutionHint_ = solutionHintBuilder_.build();
838  }
839  result.bitField0_ = to_bitField0_;
840  onBuilt();
841  return result;
842  }
843 
844  @java.lang.Override
845  public Builder clone() {
846  return super.clone();
847  }
848  @java.lang.Override
850  com.google.protobuf.Descriptors.FieldDescriptor field,
851  java.lang.Object value) {
852  return super.setField(field, value);
853  }
854  @java.lang.Override
856  com.google.protobuf.Descriptors.FieldDescriptor field) {
857  return super.clearField(field);
858  }
859  @java.lang.Override
861  com.google.protobuf.Descriptors.OneofDescriptor oneof) {
862  return super.clearOneof(oneof);
863  }
864  @java.lang.Override
866  com.google.protobuf.Descriptors.FieldDescriptor field,
867  int index, java.lang.Object value) {
868  return super.setRepeatedField(field, index, value);
869  }
870  @java.lang.Override
872  com.google.protobuf.Descriptors.FieldDescriptor field,
873  java.lang.Object value) {
874  return super.addRepeatedField(field, value);
875  }
876  @java.lang.Override
877  public Builder mergeFrom(com.google.protobuf.Message other) {
878  if (other instanceof com.google.ortools.sat.CpModelProto) {
879  return mergeFrom((com.google.ortools.sat.CpModelProto)other);
880  } else {
881  super.mergeFrom(other);
882  return this;
883  }
884  }
885 
887  if (other == com.google.ortools.sat.CpModelProto.getDefaultInstance()) return this;
888  if (!other.getName().isEmpty()) {
889  name_ = other.name_;
890  onChanged();
891  }
892  if (variablesBuilder_ == null) {
893  if (!other.variables_.isEmpty()) {
894  if (variables_.isEmpty()) {
895  variables_ = other.variables_;
896  bitField0_ = (bitField0_ & ~0x00000002);
897  } else {
898  ensureVariablesIsMutable();
899  variables_.addAll(other.variables_);
900  }
901  onChanged();
902  }
903  } else {
904  if (!other.variables_.isEmpty()) {
905  if (variablesBuilder_.isEmpty()) {
906  variablesBuilder_.dispose();
907  variablesBuilder_ = null;
908  variables_ = other.variables_;
909  bitField0_ = (bitField0_ & ~0x00000002);
910  variablesBuilder_ =
911  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
912  getVariablesFieldBuilder() : null;
913  } else {
914  variablesBuilder_.addAllMessages(other.variables_);
915  }
916  }
917  }
918  if (constraintsBuilder_ == null) {
919  if (!other.constraints_.isEmpty()) {
920  if (constraints_.isEmpty()) {
921  constraints_ = other.constraints_;
922  bitField0_ = (bitField0_ & ~0x00000004);
923  } else {
924  ensureConstraintsIsMutable();
925  constraints_.addAll(other.constraints_);
926  }
927  onChanged();
928  }
929  } else {
930  if (!other.constraints_.isEmpty()) {
931  if (constraintsBuilder_.isEmpty()) {
932  constraintsBuilder_.dispose();
933  constraintsBuilder_ = null;
934  constraints_ = other.constraints_;
935  bitField0_ = (bitField0_ & ~0x00000004);
936  constraintsBuilder_ =
937  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
938  getConstraintsFieldBuilder() : null;
939  } else {
940  constraintsBuilder_.addAllMessages(other.constraints_);
941  }
942  }
943  }
944  if (other.hasObjective()) {
945  mergeObjective(other.getObjective());
946  }
947  if (searchStrategyBuilder_ == null) {
948  if (!other.searchStrategy_.isEmpty()) {
949  if (searchStrategy_.isEmpty()) {
950  searchStrategy_ = other.searchStrategy_;
951  bitField0_ = (bitField0_ & ~0x00000010);
952  } else {
953  ensureSearchStrategyIsMutable();
954  searchStrategy_.addAll(other.searchStrategy_);
955  }
956  onChanged();
957  }
958  } else {
959  if (!other.searchStrategy_.isEmpty()) {
960  if (searchStrategyBuilder_.isEmpty()) {
961  searchStrategyBuilder_.dispose();
962  searchStrategyBuilder_ = null;
963  searchStrategy_ = other.searchStrategy_;
964  bitField0_ = (bitField0_ & ~0x00000010);
965  searchStrategyBuilder_ =
966  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
967  getSearchStrategyFieldBuilder() : null;
968  } else {
969  searchStrategyBuilder_.addAllMessages(other.searchStrategy_);
970  }
971  }
972  }
973  if (other.hasSolutionHint()) {
974  mergeSolutionHint(other.getSolutionHint());
975  }
976  this.mergeUnknownFields(other.unknownFields);
977  onChanged();
978  return this;
979  }
980 
981  @java.lang.Override
982  public final boolean isInitialized() {
983  return true;
984  }
985 
986  @java.lang.Override
988  com.google.protobuf.CodedInputStream input,
989  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
990  throws java.io.IOException {
991  com.google.ortools.sat.CpModelProto parsedMessage = null;
992  try {
993  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
994  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
995  parsedMessage = (com.google.ortools.sat.CpModelProto) e.getUnfinishedMessage();
996  throw e.unwrapIOException();
997  } finally {
998  if (parsedMessage != null) {
999  mergeFrom(parsedMessage);
1000  }
1001  }
1002  return this;
1003  }
1004  private int bitField0_;
1005 
1006  private java.lang.Object name_ = "";
1014  public java.lang.String getName() {
1015  java.lang.Object ref = name_;
1016  if (!(ref instanceof java.lang.String)) {
1017  com.google.protobuf.ByteString bs =
1018  (com.google.protobuf.ByteString) ref;
1019  java.lang.String s = bs.toStringUtf8();
1020  name_ = s;
1021  return s;
1022  } else {
1023  return (java.lang.String) ref;
1024  }
1025  }
1033  public com.google.protobuf.ByteString
1035  java.lang.Object ref = name_;
1036  if (ref instanceof String) {
1037  com.google.protobuf.ByteString b =
1038  com.google.protobuf.ByteString.copyFromUtf8(
1039  (java.lang.String) ref);
1040  name_ = b;
1041  return b;
1042  } else {
1043  return (com.google.protobuf.ByteString) ref;
1044  }
1045  }
1054  java.lang.String value) {
1055  if (value == null) {
1056  throw new NullPointerException();
1057  }
1058 
1059  name_ = value;
1060  onChanged();
1061  return this;
1062  }
1070  public Builder clearName() {
1071 
1072  name_ = getDefaultInstance().getName();
1073  onChanged();
1074  return this;
1075  }
1084  com.google.protobuf.ByteString value) {
1085  if (value == null) {
1086  throw new NullPointerException();
1087  }
1088  checkByteStringIsUtf8(value);
1089 
1090  name_ = value;
1091  onChanged();
1092  return this;
1093  }
1094 
1095  private java.util.List<com.google.ortools.sat.IntegerVariableProto> variables_ =
1096  java.util.Collections.emptyList();
1097  private void ensureVariablesIsMutable() {
1098  if (!((bitField0_ & 0x00000002) != 0)) {
1099  variables_ = new java.util.ArrayList<com.google.ortools.sat.IntegerVariableProto>(variables_);
1100  bitField0_ |= 0x00000002;
1101  }
1102  }
1103 
1104  private com.google.protobuf.RepeatedFieldBuilderV3<
1106 
1115  if (variablesBuilder_ == null) {
1116  return java.util.Collections.unmodifiableList(variables_);
1117  } else {
1118  return variablesBuilder_.getMessageList();
1119  }
1120  }
1128  public int getVariablesCount() {
1129  if (variablesBuilder_ == null) {
1130  return variables_.size();
1131  } else {
1132  return variablesBuilder_.getCount();
1133  }
1134  }
1143  if (variablesBuilder_ == null) {
1144  return variables_.get(index);
1145  } else {
1146  return variablesBuilder_.getMessage(index);
1147  }
1148  }
1157  int index, com.google.ortools.sat.IntegerVariableProto value) {
1158  if (variablesBuilder_ == null) {
1159  if (value == null) {
1160  throw new NullPointerException();
1161  }
1162  ensureVariablesIsMutable();
1163  variables_.set(index, value);
1164  onChanged();
1165  } else {
1166  variablesBuilder_.setMessage(index, value);
1167  }
1168  return this;
1169  }
1178  int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1179  if (variablesBuilder_ == null) {
1180  ensureVariablesIsMutable();
1181  variables_.set(index, builderForValue.build());
1182  onChanged();
1183  } else {
1184  variablesBuilder_.setMessage(index, builderForValue.build());
1185  }
1186  return this;
1187  }
1196  if (variablesBuilder_ == null) {
1197  if (value == null) {
1198  throw new NullPointerException();
1199  }
1200  ensureVariablesIsMutable();
1201  variables_.add(value);
1202  onChanged();
1203  } else {
1204  variablesBuilder_.addMessage(value);
1205  }
1206  return this;
1207  }
1216  int index, com.google.ortools.sat.IntegerVariableProto value) {
1217  if (variablesBuilder_ == null) {
1218  if (value == null) {
1219  throw new NullPointerException();
1220  }
1221  ensureVariablesIsMutable();
1222  variables_.add(index, value);
1223  onChanged();
1224  } else {
1225  variablesBuilder_.addMessage(index, value);
1226  }
1227  return this;
1228  }
1237  com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1238  if (variablesBuilder_ == null) {
1239  ensureVariablesIsMutable();
1240  variables_.add(builderForValue.build());
1241  onChanged();
1242  } else {
1243  variablesBuilder_.addMessage(builderForValue.build());
1244  }
1245  return this;
1246  }
1255  int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1256  if (variablesBuilder_ == null) {
1257  ensureVariablesIsMutable();
1258  variables_.add(index, builderForValue.build());
1259  onChanged();
1260  } else {
1261  variablesBuilder_.addMessage(index, builderForValue.build());
1262  }
1263  return this;
1264  }
1273  java.lang.Iterable<? extends com.google.ortools.sat.IntegerVariableProto> values) {
1274  if (variablesBuilder_ == null) {
1275  ensureVariablesIsMutable();
1276  com.google.protobuf.AbstractMessageLite.Builder.addAll(
1277  values, variables_);
1278  onChanged();
1279  } else {
1280  variablesBuilder_.addAllMessages(values);
1281  }
1282  return this;
1283  }
1292  if (variablesBuilder_ == null) {
1293  variables_ = java.util.Collections.emptyList();
1294  bitField0_ = (bitField0_ & ~0x00000002);
1295  onChanged();
1296  } else {
1297  variablesBuilder_.clear();
1298  }
1299  return this;
1300  }
1308  public Builder removeVariables(int index) {
1309  if (variablesBuilder_ == null) {
1310  ensureVariablesIsMutable();
1311  variables_.remove(index);
1312  onChanged();
1313  } else {
1314  variablesBuilder_.remove(index);
1315  }
1316  return this;
1317  }
1326  int index) {
1327  return getVariablesFieldBuilder().getBuilder(index);
1328  }
1337  int index) {
1338  if (variablesBuilder_ == null) {
1339  return variables_.get(index); } else {
1340  return variablesBuilder_.getMessageOrBuilder(index);
1341  }
1342  }
1350  public java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder>
1352  if (variablesBuilder_ != null) {
1353  return variablesBuilder_.getMessageOrBuilderList();
1354  } else {
1355  return java.util.Collections.unmodifiableList(variables_);
1356  }
1357  }
1366  return getVariablesFieldBuilder().addBuilder(
1368  }
1377  int index) {
1378  return getVariablesFieldBuilder().addBuilder(
1380  }
1388  public java.util.List<com.google.ortools.sat.IntegerVariableProto.Builder>
1390  return getVariablesFieldBuilder().getBuilderList();
1391  }
1392  private com.google.protobuf.RepeatedFieldBuilderV3<
1394  getVariablesFieldBuilder() {
1395  if (variablesBuilder_ == null) {
1396  variablesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1398  variables_,
1399  ((bitField0_ & 0x00000002) != 0),
1400  getParentForChildren(),
1401  isClean());
1402  variables_ = null;
1403  }
1404  return variablesBuilder_;
1405  }
1406 
1407  private java.util.List<com.google.ortools.sat.ConstraintProto> constraints_ =
1408  java.util.Collections.emptyList();
1409  private void ensureConstraintsIsMutable() {
1410  if (!((bitField0_ & 0x00000004) != 0)) {
1411  constraints_ = new java.util.ArrayList<com.google.ortools.sat.ConstraintProto>(constraints_);
1412  bitField0_ |= 0x00000004;
1413  }
1414  }
1415 
1416  private com.google.protobuf.RepeatedFieldBuilderV3<
1418 
1423  if (constraintsBuilder_ == null) {
1424  return java.util.Collections.unmodifiableList(constraints_);
1425  } else {
1426  return constraintsBuilder_.getMessageList();
1427  }
1428  }
1432  public int getConstraintsCount() {
1433  if (constraintsBuilder_ == null) {
1434  return constraints_.size();
1435  } else {
1436  return constraintsBuilder_.getCount();
1437  }
1438  }
1443  if (constraintsBuilder_ == null) {
1444  return constraints_.get(index);
1445  } else {
1446  return constraintsBuilder_.getMessage(index);
1447  }
1448  }
1453  int index, com.google.ortools.sat.ConstraintProto value) {
1454  if (constraintsBuilder_ == null) {
1455  if (value == null) {
1456  throw new NullPointerException();
1457  }
1458  ensureConstraintsIsMutable();
1459  constraints_.set(index, value);
1460  onChanged();
1461  } else {
1462  constraintsBuilder_.setMessage(index, value);
1463  }
1464  return this;
1465  }
1470  int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1471  if (constraintsBuilder_ == null) {
1472  ensureConstraintsIsMutable();
1473  constraints_.set(index, builderForValue.build());
1474  onChanged();
1475  } else {
1476  constraintsBuilder_.setMessage(index, builderForValue.build());
1477  }
1478  return this;
1479  }
1484  if (constraintsBuilder_ == null) {
1485  if (value == null) {
1486  throw new NullPointerException();
1487  }
1488  ensureConstraintsIsMutable();
1489  constraints_.add(value);
1490  onChanged();
1491  } else {
1492  constraintsBuilder_.addMessage(value);
1493  }
1494  return this;
1495  }
1500  int index, com.google.ortools.sat.ConstraintProto value) {
1501  if (constraintsBuilder_ == null) {
1502  if (value == null) {
1503  throw new NullPointerException();
1504  }
1505  ensureConstraintsIsMutable();
1506  constraints_.add(index, value);
1507  onChanged();
1508  } else {
1509  constraintsBuilder_.addMessage(index, value);
1510  }
1511  return this;
1512  }
1517  com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1518  if (constraintsBuilder_ == null) {
1519  ensureConstraintsIsMutable();
1520  constraints_.add(builderForValue.build());
1521  onChanged();
1522  } else {
1523  constraintsBuilder_.addMessage(builderForValue.build());
1524  }
1525  return this;
1526  }
1531  int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1532  if (constraintsBuilder_ == null) {
1533  ensureConstraintsIsMutable();
1534  constraints_.add(index, builderForValue.build());
1535  onChanged();
1536  } else {
1537  constraintsBuilder_.addMessage(index, builderForValue.build());
1538  }
1539  return this;
1540  }
1545  java.lang.Iterable<? extends com.google.ortools.sat.ConstraintProto> values) {
1546  if (constraintsBuilder_ == null) {
1547  ensureConstraintsIsMutable();
1548  com.google.protobuf.AbstractMessageLite.Builder.addAll(
1549  values, constraints_);
1550  onChanged();
1551  } else {
1552  constraintsBuilder_.addAllMessages(values);
1553  }
1554  return this;
1555  }
1560  if (constraintsBuilder_ == null) {
1561  constraints_ = java.util.Collections.emptyList();
1562  bitField0_ = (bitField0_ & ~0x00000004);
1563  onChanged();
1564  } else {
1565  constraintsBuilder_.clear();
1566  }
1567  return this;
1568  }
1572  public Builder removeConstraints(int index) {
1573  if (constraintsBuilder_ == null) {
1574  ensureConstraintsIsMutable();
1575  constraints_.remove(index);
1576  onChanged();
1577  } else {
1578  constraintsBuilder_.remove(index);
1579  }
1580  return this;
1581  }
1586  int index) {
1587  return getConstraintsFieldBuilder().getBuilder(index);
1588  }
1593  int index) {
1594  if (constraintsBuilder_ == null) {
1595  return constraints_.get(index); } else {
1596  return constraintsBuilder_.getMessageOrBuilder(index);
1597  }
1598  }
1602  public java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder>
1604  if (constraintsBuilder_ != null) {
1605  return constraintsBuilder_.getMessageOrBuilderList();
1606  } else {
1607  return java.util.Collections.unmodifiableList(constraints_);
1608  }
1609  }
1614  return getConstraintsFieldBuilder().addBuilder(
1616  }
1621  int index) {
1622  return getConstraintsFieldBuilder().addBuilder(
1624  }
1628  public java.util.List<com.google.ortools.sat.ConstraintProto.Builder>
1630  return getConstraintsFieldBuilder().getBuilderList();
1631  }
1632  private com.google.protobuf.RepeatedFieldBuilderV3<
1634  getConstraintsFieldBuilder() {
1635  if (constraintsBuilder_ == null) {
1636  constraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1638  constraints_,
1639  ((bitField0_ & 0x00000004) != 0),
1640  getParentForChildren(),
1641  isClean());
1642  constraints_ = null;
1643  }
1644  return constraintsBuilder_;
1645  }
1646 
1647  private com.google.ortools.sat.CpObjectiveProto objective_;
1648  private com.google.protobuf.SingleFieldBuilderV3<
1657  public boolean hasObjective() {
1658  return objectiveBuilder_ != null || objective_ != null;
1659  }
1668  if (objectiveBuilder_ == null) {
1669  return objective_ == null ? com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
1670  } else {
1671  return objectiveBuilder_.getMessage();
1672  }
1673  }
1682  if (objectiveBuilder_ == null) {
1683  if (value == null) {
1684  throw new NullPointerException();
1685  }
1686  objective_ = value;
1687  onChanged();
1688  } else {
1689  objectiveBuilder_.setMessage(value);
1690  }
1691 
1692  return this;
1693  }
1702  com.google.ortools.sat.CpObjectiveProto.Builder builderForValue) {
1703  if (objectiveBuilder_ == null) {
1704  objective_ = builderForValue.build();
1705  onChanged();
1706  } else {
1707  objectiveBuilder_.setMessage(builderForValue.build());
1708  }
1709 
1710  return this;
1711  }
1720  if (objectiveBuilder_ == null) {
1721  if (objective_ != null) {
1722  objective_ =
1724  } else {
1725  objective_ = value;
1726  }
1727  onChanged();
1728  } else {
1729  objectiveBuilder_.mergeFrom(value);
1730  }
1731 
1732  return this;
1733  }
1742  if (objectiveBuilder_ == null) {
1743  objective_ = null;
1744  onChanged();
1745  } else {
1746  objective_ = null;
1747  objectiveBuilder_ = null;
1748  }
1749 
1750  return this;
1751  }
1760 
1761  onChanged();
1762  return getObjectiveFieldBuilder().getBuilder();
1763  }
1772  if (objectiveBuilder_ != null) {
1773  return objectiveBuilder_.getMessageOrBuilder();
1774  } else {
1775  return objective_ == null ?
1777  }
1778  }
1786  private com.google.protobuf.SingleFieldBuilderV3<
1788  getObjectiveFieldBuilder() {
1789  if (objectiveBuilder_ == null) {
1790  objectiveBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
1792  getObjective(),
1793  getParentForChildren(),
1794  isClean());
1795  objective_ = null;
1796  }
1797  return objectiveBuilder_;
1798  }
1799 
1800  private java.util.List<com.google.ortools.sat.DecisionStrategyProto> searchStrategy_ =
1801  java.util.Collections.emptyList();
1802  private void ensureSearchStrategyIsMutable() {
1803  if (!((bitField0_ & 0x00000010) != 0)) {
1804  searchStrategy_ = new java.util.ArrayList<com.google.ortools.sat.DecisionStrategyProto>(searchStrategy_);
1805  bitField0_ |= 0x00000010;
1806  }
1807  }
1808 
1809  private com.google.protobuf.RepeatedFieldBuilderV3<
1811 
1828  if (searchStrategyBuilder_ == null) {
1829  return java.util.Collections.unmodifiableList(searchStrategy_);
1830  } else {
1831  return searchStrategyBuilder_.getMessageList();
1832  }
1833  }
1849  public int getSearchStrategyCount() {
1850  if (searchStrategyBuilder_ == null) {
1851  return searchStrategy_.size();
1852  } else {
1853  return searchStrategyBuilder_.getCount();
1854  }
1855  }
1872  if (searchStrategyBuilder_ == null) {
1873  return searchStrategy_.get(index);
1874  } else {
1875  return searchStrategyBuilder_.getMessage(index);
1876  }
1877  }
1894  int index, com.google.ortools.sat.DecisionStrategyProto value) {
1895  if (searchStrategyBuilder_ == null) {
1896  if (value == null) {
1897  throw new NullPointerException();
1898  }
1899  ensureSearchStrategyIsMutable();
1900  searchStrategy_.set(index, value);
1901  onChanged();
1902  } else {
1903  searchStrategyBuilder_.setMessage(index, value);
1904  }
1905  return this;
1906  }
1923  int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
1924  if (searchStrategyBuilder_ == null) {
1925  ensureSearchStrategyIsMutable();
1926  searchStrategy_.set(index, builderForValue.build());
1927  onChanged();
1928  } else {
1929  searchStrategyBuilder_.setMessage(index, builderForValue.build());
1930  }
1931  return this;
1932  }
1949  if (searchStrategyBuilder_ == null) {
1950  if (value == null) {
1951  throw new NullPointerException();
1952  }
1953  ensureSearchStrategyIsMutable();
1954  searchStrategy_.add(value);
1955  onChanged();
1956  } else {
1957  searchStrategyBuilder_.addMessage(value);
1958  }
1959  return this;
1960  }
1977  int index, com.google.ortools.sat.DecisionStrategyProto value) {
1978  if (searchStrategyBuilder_ == null) {
1979  if (value == null) {
1980  throw new NullPointerException();
1981  }
1982  ensureSearchStrategyIsMutable();
1983  searchStrategy_.add(index, value);
1984  onChanged();
1985  } else {
1986  searchStrategyBuilder_.addMessage(index, value);
1987  }
1988  return this;
1989  }
2006  com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
2007  if (searchStrategyBuilder_ == null) {
2008  ensureSearchStrategyIsMutable();
2009  searchStrategy_.add(builderForValue.build());
2010  onChanged();
2011  } else {
2012  searchStrategyBuilder_.addMessage(builderForValue.build());
2013  }
2014  return this;
2015  }
2032  int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
2033  if (searchStrategyBuilder_ == null) {
2034  ensureSearchStrategyIsMutable();
2035  searchStrategy_.add(index, builderForValue.build());
2036  onChanged();
2037  } else {
2038  searchStrategyBuilder_.addMessage(index, builderForValue.build());
2039  }
2040  return this;
2041  }
2058  java.lang.Iterable<? extends com.google.ortools.sat.DecisionStrategyProto> values) {
2059  if (searchStrategyBuilder_ == null) {
2060  ensureSearchStrategyIsMutable();
2061  com.google.protobuf.AbstractMessageLite.Builder.addAll(
2062  values, searchStrategy_);
2063  onChanged();
2064  } else {
2065  searchStrategyBuilder_.addAllMessages(values);
2066  }
2067  return this;
2068  }
2085  if (searchStrategyBuilder_ == null) {
2086  searchStrategy_ = java.util.Collections.emptyList();
2087  bitField0_ = (bitField0_ & ~0x00000010);
2088  onChanged();
2089  } else {
2090  searchStrategyBuilder_.clear();
2091  }
2092  return this;
2093  }
2109  public Builder removeSearchStrategy(int index) {
2110  if (searchStrategyBuilder_ == null) {
2111  ensureSearchStrategyIsMutable();
2112  searchStrategy_.remove(index);
2113  onChanged();
2114  } else {
2115  searchStrategyBuilder_.remove(index);
2116  }
2117  return this;
2118  }
2135  int index) {
2136  return getSearchStrategyFieldBuilder().getBuilder(index);
2137  }
2154  int index) {
2155  if (searchStrategyBuilder_ == null) {
2156  return searchStrategy_.get(index); } else {
2157  return searchStrategyBuilder_.getMessageOrBuilder(index);
2158  }
2159  }
2175  public java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
2177  if (searchStrategyBuilder_ != null) {
2178  return searchStrategyBuilder_.getMessageOrBuilderList();
2179  } else {
2180  return java.util.Collections.unmodifiableList(searchStrategy_);
2181  }
2182  }
2199  return getSearchStrategyFieldBuilder().addBuilder(
2201  }
2218  int index) {
2219  return getSearchStrategyFieldBuilder().addBuilder(
2221  }
2237  public java.util.List<com.google.ortools.sat.DecisionStrategyProto.Builder>
2239  return getSearchStrategyFieldBuilder().getBuilderList();
2240  }
2241  private com.google.protobuf.RepeatedFieldBuilderV3<
2243  getSearchStrategyFieldBuilder() {
2244  if (searchStrategyBuilder_ == null) {
2245  searchStrategyBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
2247  searchStrategy_,
2248  ((bitField0_ & 0x00000010) != 0),
2249  getParentForChildren(),
2250  isClean());
2251  searchStrategy_ = null;
2252  }
2253  return searchStrategyBuilder_;
2254  }
2255 
2256  private com.google.ortools.sat.PartialVariableAssignment solutionHint_;
2257  private com.google.protobuf.SingleFieldBuilderV3<
2274  public boolean hasSolutionHint() {
2275  return solutionHintBuilder_ != null || solutionHint_ != null;
2276  }
2293  if (solutionHintBuilder_ == null) {
2294  return solutionHint_ == null ? com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
2295  } else {
2296  return solutionHintBuilder_.getMessage();
2297  }
2298  }
2315  if (solutionHintBuilder_ == null) {
2316  if (value == null) {
2317  throw new NullPointerException();
2318  }
2319  solutionHint_ = value;
2320  onChanged();
2321  } else {
2322  solutionHintBuilder_.setMessage(value);
2323  }
2324 
2325  return this;
2326  }
2344  if (solutionHintBuilder_ == null) {
2345  solutionHint_ = builderForValue.build();
2346  onChanged();
2347  } else {
2348  solutionHintBuilder_.setMessage(builderForValue.build());
2349  }
2350 
2351  return this;
2352  }
2369  if (solutionHintBuilder_ == null) {
2370  if (solutionHint_ != null) {
2371  solutionHint_ =
2373  } else {
2374  solutionHint_ = value;
2375  }
2376  onChanged();
2377  } else {
2378  solutionHintBuilder_.mergeFrom(value);
2379  }
2380 
2381  return this;
2382  }
2399  if (solutionHintBuilder_ == null) {
2400  solutionHint_ = null;
2401  onChanged();
2402  } else {
2403  solutionHint_ = null;
2404  solutionHintBuilder_ = null;
2405  }
2406 
2407  return this;
2408  }
2425 
2426  onChanged();
2427  return getSolutionHintFieldBuilder().getBuilder();
2428  }
2445  if (solutionHintBuilder_ != null) {
2446  return solutionHintBuilder_.getMessageOrBuilder();
2447  } else {
2448  return solutionHint_ == null ?
2450  }
2451  }
2467  private com.google.protobuf.SingleFieldBuilderV3<
2469  getSolutionHintFieldBuilder() {
2470  if (solutionHintBuilder_ == null) {
2471  solutionHintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
2473  getSolutionHint(),
2474  getParentForChildren(),
2475  isClean());
2476  solutionHint_ = null;
2477  }
2478  return solutionHintBuilder_;
2479  }
2480  @java.lang.Override
2482  final com.google.protobuf.UnknownFieldSet unknownFields) {
2483  return super.setUnknownFields(unknownFields);
2484  }
2485 
2486  @java.lang.Override
2488  final com.google.protobuf.UnknownFieldSet unknownFields) {
2489  return super.mergeUnknownFields(unknownFields);
2490  }
2491 
2492 
2493  // @@protoc_insertion_point(builder_scope:operations_research.sat.CpModelProto)
2494  }
2495 
2496  // @@protoc_insertion_point(class_scope:operations_research.sat.CpModelProto)
2497  private static final com.google.ortools.sat.CpModelProto DEFAULT_INSTANCE;
2498  static {
2499  DEFAULT_INSTANCE = new com.google.ortools.sat.CpModelProto();
2500  }
2501 
2503  return DEFAULT_INSTANCE;
2504  }
2505 
2506  private static final com.google.protobuf.Parser<CpModelProto>
2507  PARSER = new com.google.protobuf.AbstractParser<CpModelProto>() {
2508  @java.lang.Override
2509  public CpModelProto parsePartialFrom(
2510  com.google.protobuf.CodedInputStream input,
2511  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2512  throws com.google.protobuf.InvalidProtocolBufferException {
2513  return new CpModelProto(input, extensionRegistry);
2514  }
2515  };
2516 
2517  public static com.google.protobuf.Parser<CpModelProto> parser() {
2518  return PARSER;
2519  }
2520 
2521  @java.lang.Override
2522  public com.google.protobuf.Parser<CpModelProto> getParserForType() {
2523  return PARSER;
2524  }
2525 
2526  @java.lang.Override
2528  return DEFAULT_INSTANCE;
2529  }
2530 
2531 }
2532 
.lang.Override boolean equals(final java.lang.Object obj)
Builder addAllConstraints(java.lang.Iterable<? extends com.google.ortools.sat.ConstraintProto > values)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addVariables(com.google.ortools.sat.IntegerVariableProto value)
java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder > getSearchStrategyOrBuilderList()
Builder setConstraints(int index, com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
java.util.List< com.google.ortools.sat.ConstraintProto > getConstraintsList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addConstraints(com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder setSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto value)
static com.google.ortools.sat.CpModelProto getDefaultInstance()
java.util.List< com.google.ortools.sat.ConstraintProto.Builder > getConstraintsBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override final boolean isInitialized()
java.util.List< com.google.ortools.sat.DecisionStrategyProto > getSearchStrategyList()
.lang.Override int getSerializedSize()
java.util.List< com.google.ortools.sat.IntegerVariableProto > getVariablesList()
java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder > getVariablesOrBuilderList()
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder()
static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input)
Builder addSearchStrategy(com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
static com.google.ortools.sat.CpModelProto parseFrom(java.nio.ByteBuffer data)
Builder addSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto value)
static com.google.protobuf.Parser< DecisionStrategyProto > parser()
static com.google.ortools.sat.CpModelProto parseFrom(byte[] data)
com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(int index)
.lang.Override final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
.lang.Override final com.google.protobuf.UnknownFieldSet getUnknownFields()
Builder addAllVariables(java.lang.Iterable<? extends com.google.ortools.sat.IntegerVariableProto > values)
static com.google.protobuf.Parser< ConstraintProto > parser()
static Builder newBuilder(com.google.ortools.sat.CpModelProto prototype)
Builder addSearchStrategy(com.google.ortools.sat.DecisionStrategyProto value)
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
Builder addSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder > getConstraintsOrBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder clearConstraints()
repeated .operations_research.sat.ConstraintProto constraints = 3;
java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder > getSearchStrategyOrBuilderList()
int getConstraintsCount()
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder setSolutionHint(com.google.ortools.sat.PartialVariableAssignment.Builder builderForValue)
Builder setSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
Builder mergeSolutionHint(com.google.ortools.sat.PartialVariableAssignment value)
static com.google.ortools.sat.PartialVariableAssignment getDefaultInstance()
.lang.Override Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
com.google.ortools.sat.ConstraintProto.Builder addConstraintsBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override com.google.ortools.sat.CpModelProto getDefaultInstanceForType()
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder()
Builder setNameBytes(com.google.protobuf.ByteString value)
static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input)
com.google.ortools.sat.IntegerVariableProto getVariables(int index)
com.google.ortools.sat.PartialVariableAssignment getSolutionHint()
static com.google.ortools.sat.CpObjectiveProto getDefaultInstance()
com.google.ortools.sat.PartialVariableAssignment.Builder getSolutionHintBuilder()
.lang.Override com.google.ortools.sat.CpObjectiveProto buildPartial()
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.IntegerVariableProto getDefaultInstance()
com.google.ortools.sat.DecisionStrategyProto.Builder addSearchStrategyBuilder()
Builder setObjective(com.google.ortools.sat.CpObjectiveProto.Builder builderForValue)
java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder > getVariablesOrBuilderList()
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.util.List< com.google.ortools.sat.DecisionStrategyProto.Builder > getSearchStrategyBuilderList()
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CpModelProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder setSolutionHint(com.google.ortools.sat.PartialVariableAssignment value)
.lang.Override boolean equals(final java.lang.Object obj)
.lang.Override boolean equals(final java.lang.Object obj)
Builder addAllSearchStrategy(java.lang.Iterable<? extends com.google.ortools.sat.DecisionStrategyProto > values)
static com.google.protobuf.Parser< PartialVariableAssignment > parser()
Builder addVariables(int index, com.google.ortools.sat.IntegerVariableProto value)
static final int SEARCH_STRATEGY_FIELD_NUMBER
com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(int index)
.lang.Override final boolean isInitialized()
com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder mergeFrom(com.google.ortools.sat.CpModelProto other)
com.google.protobuf.ByteString getNameBytes()
Builder setName(java.lang.String value)
com.google.ortools.sat.IntegerVariableProto getVariables(int index)
.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder addConstraints(int index, com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addVariables(int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
Builder addConstraints(com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder > getConstraintsOrBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
static com.google.protobuf.Parser< CpObjectiveProto > parser()
com.google.ortools.sat.ConstraintProto getConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override com.google.ortools.sat.CpModelProto getDefaultInstanceForType()
com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder()
com.google.ortools.sat.ConstraintProto.Builder addConstraintsBuilder()
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.DecisionStrategyProto getSearchStrategy(int index)
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
.lang.Override final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
com.google.ortools.sat.ConstraintProto getConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.CodedInputStream input)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.sat.DecisionStrategyProto.Builder getSearchStrategyBuilder(int index)
com.google.ortools.sat.CpObjectiveProto.Builder getObjectiveBuilder()
int getConstraintsCount()
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.CpModelProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.DecisionStrategyProto getSearchStrategy(int index)
.lang.Override com.google.ortools.sat.PartialVariableAssignment buildPartial()
Builder setObjective(com.google.ortools.sat.CpObjectiveProto value)
com.google.ortools.sat.ConstraintProto.Builder getConstraintsBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(int index)
.lang.Override Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
static com.google.ortools.sat.ConstraintProto getDefaultInstance()
.lang.Override Builder newBuilderForType()
com.google.ortools.sat.IntegerVariableProto.Builder addVariablesBuilder(int index)
static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.util.List< com.google.ortools.sat.IntegerVariableProto.Builder > getVariablesBuilderList()
Builder mergeObjective(com.google.ortools.sat.CpObjectiveProto value)
com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder()
com.google.ortools.sat.CpObjectiveProto getObjective()
.lang.Override com.google.ortools.sat.CpModelProto buildPartial()
com.google.ortools.sat.IntegerVariableProto.Builder addVariablesBuilder()
.lang.Override Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
static com.google.protobuf.Parser< IntegerVariableProto > parser()
com.google.ortools.sat.CpObjectiveProto getObjective()
com.google.ortools.sat.PartialVariableAssignment getSolutionHint()
.lang.Override com.google.ortools.sat.CpModelProto build()
com.google.ortools.sat.DecisionStrategyProto.Builder addSearchStrategyBuilder(int index)
.lang.Override Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
.lang.Override com.google.protobuf.Parser< CpModelProto > getParserForType()
com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(int index)
.lang.Override Builder toBuilder()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
java.util.List< com.google.ortools.sat.IntegerVariableProto > getVariablesList()
Builder setVariables(int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
Builder removeConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.protobuf.ByteString getNameBytes()
static com.google.protobuf.Parser< CpModelProto > parser()
Builder addConstraints(int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override void writeTo(com.google.protobuf.CodedOutputStream output)
Builder addVariables(com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
.lang.Override Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
com.google.ortools.sat.IntegerVariableProto.Builder getVariablesBuilder(int index)
.lang.Override Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.DecisionStrategyProto getDefaultInstance()
Builder setVariables(int index, com.google.ortools.sat.IntegerVariableProto value)
Builder setConstraints(int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
java.util.List< com.google.ortools.sat.DecisionStrategyProto > getSearchStrategyList()
java.util.List< com.google.ortools.sat.ConstraintProto > getConstraintsList()
repeated .operations_research.sat.ConstraintProto constraints = 3;