Reference

C++

Python

DotNET

Java Documentation

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)
16  CpModelProtoOrBuilder {
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  @SuppressWarnings({"unused"})
31  protected java.lang.Object newInstance(
32  UnusedPrivateParameter unused) {
33  return new CpModelProto();
34  }
35 
36  @java.lang.Override
37  public final com.google.protobuf.UnknownFieldSet
39  return this.unknownFields;
40  }
41  private CpModelProto(
42  com.google.protobuf.CodedInputStream input,
43  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
44  throws com.google.protobuf.InvalidProtocolBufferException {
45  this();
46  if (extensionRegistry == null) {
47  throw new java.lang.NullPointerException();
48  }
49  int mutable_bitField0_ = 0;
50  com.google.protobuf.UnknownFieldSet.Builder unknownFields =
51  com.google.protobuf.UnknownFieldSet.newBuilder();
52  try {
53  boolean done = false;
54  while (!done) {
55  int tag = input.readTag();
56  switch (tag) {
57  case 0:
58  done = true;
59  break;
60  case 10: {
61  java.lang.String s = input.readStringRequireUtf8();
62 
63  name_ = s;
64  break;
65  }
66  case 18: {
67  if (!((mutable_bitField0_ & 0x00000001) != 0)) {
68  variables_ = new java.util.ArrayList<com.google.ortools.sat.IntegerVariableProto>();
69  mutable_bitField0_ |= 0x00000001;
70  }
71  variables_.add(
72  input.readMessage(com.google.ortools.sat.IntegerVariableProto.parser(), extensionRegistry));
73  break;
74  }
75  case 26: {
76  if (!((mutable_bitField0_ & 0x00000002) != 0)) {
77  constraints_ = new java.util.ArrayList<com.google.ortools.sat.ConstraintProto>();
78  mutable_bitField0_ |= 0x00000002;
79  }
80  constraints_.add(
81  input.readMessage(com.google.ortools.sat.ConstraintProto.parser(), extensionRegistry));
82  break;
83  }
84  case 34: {
85  com.google.ortools.sat.CpObjectiveProto.Builder subBuilder = null;
86  if (objective_ != null) {
87  subBuilder = objective_.toBuilder();
88  }
89  objective_ = input.readMessage(com.google.ortools.sat.CpObjectiveProto.parser(), extensionRegistry);
90  if (subBuilder != null) {
91  subBuilder.mergeFrom(objective_);
92  objective_ = subBuilder.buildPartial();
93  }
94 
95  break;
96  }
97  case 42: {
98  if (!((mutable_bitField0_ & 0x00000004) != 0)) {
99  searchStrategy_ = new java.util.ArrayList<com.google.ortools.sat.DecisionStrategyProto>();
100  mutable_bitField0_ |= 0x00000004;
101  }
102  searchStrategy_.add(
103  input.readMessage(com.google.ortools.sat.DecisionStrategyProto.parser(), extensionRegistry));
104  break;
105  }
106  case 50: {
107  com.google.ortools.sat.PartialVariableAssignment.Builder subBuilder = null;
108  if (solutionHint_ != null) {
109  subBuilder = solutionHint_.toBuilder();
110  }
111  solutionHint_ = input.readMessage(com.google.ortools.sat.PartialVariableAssignment.parser(), extensionRegistry);
112  if (subBuilder != null) {
113  subBuilder.mergeFrom(solutionHint_);
114  solutionHint_ = subBuilder.buildPartial();
115  }
116 
117  break;
118  }
119  default: {
120  if (!parseUnknownField(
121  input, unknownFields, extensionRegistry, tag)) {
122  done = true;
123  }
124  break;
125  }
126  }
127  }
128  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
129  throw e.setUnfinishedMessage(this);
130  } catch (java.io.IOException e) {
131  throw new com.google.protobuf.InvalidProtocolBufferException(
132  e).setUnfinishedMessage(this);
133  } finally {
134  if (((mutable_bitField0_ & 0x00000001) != 0)) {
135  variables_ = java.util.Collections.unmodifiableList(variables_);
136  }
137  if (((mutable_bitField0_ & 0x00000002) != 0)) {
138  constraints_ = java.util.Collections.unmodifiableList(constraints_);
139  }
140  if (((mutable_bitField0_ & 0x00000004) != 0)) {
141  searchStrategy_ = java.util.Collections.unmodifiableList(searchStrategy_);
142  }
143  this.unknownFields = unknownFields.build();
144  makeExtensionsImmutable();
145  }
146  }
147  public static final com.google.protobuf.Descriptors.Descriptor
149  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
150  }
151 
152  @java.lang.Override
153  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
155  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_fieldAccessorTable
156  .ensureFieldAccessorsInitialized(
158  }
159 
160  public static final int NAME_FIELD_NUMBER = 1;
161  private volatile java.lang.Object name_;
169  public java.lang.String getName() {
170  java.lang.Object ref = name_;
171  if (ref instanceof java.lang.String) {
172  return (java.lang.String) ref;
173  } else {
174  com.google.protobuf.ByteString bs =
175  (com.google.protobuf.ByteString) ref;
176  java.lang.String s = bs.toStringUtf8();
177  name_ = s;
178  return s;
179  }
180  }
188  public com.google.protobuf.ByteString
190  java.lang.Object ref = name_;
191  if (ref instanceof java.lang.String) {
192  com.google.protobuf.ByteString b =
193  com.google.protobuf.ByteString.copyFromUtf8(
194  (java.lang.String) ref);
195  name_ = b;
196  return b;
197  } else {
198  return (com.google.protobuf.ByteString) ref;
199  }
200  }
201 
202  public static final int VARIABLES_FIELD_NUMBER = 2;
203  private java.util.List<com.google.ortools.sat.IntegerVariableProto> variables_;
212  return variables_;
213  }
221  public java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder>
223  return variables_;
224  }
232  public int getVariablesCount() {
233  return variables_.size();
234  }
243  return variables_.get(index);
244  }
252  public com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(
253  int index) {
254  return variables_.get(index);
255  }
256 
257  public static final int CONSTRAINTS_FIELD_NUMBER = 3;
258  private java.util.List<com.google.ortools.sat.ConstraintProto> constraints_;
263  return constraints_;
264  }
268  public java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder>
270  return constraints_;
271  }
275  public int getConstraintsCount() {
276  return constraints_.size();
277  }
282  return constraints_.get(index);
283  }
287  public com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(
288  int index) {
289  return constraints_.get(index);
290  }
291 
292  public static final int OBJECTIVE_FIELD_NUMBER = 4;
293  private com.google.ortools.sat.CpObjectiveProto objective_;
301  public boolean hasObjective() {
302  return objective_ != null;
303  }
312  return objective_ == null ? com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
313  }
321  public com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder() {
322  return getObjective();
323  }
324 
325  public static final int SEARCH_STRATEGY_FIELD_NUMBER = 5;
326  private java.util.List<com.google.ortools.sat.DecisionStrategyProto> searchStrategy_;
343  return searchStrategy_;
344  }
360  public java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
362  return searchStrategy_;
363  }
379  public int getSearchStrategyCount() {
380  return searchStrategy_.size();
381  }
398  return searchStrategy_.get(index);
399  }
415  public com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(
416  int index) {
417  return searchStrategy_.get(index);
418  }
419 
420  public static final int SOLUTION_HINT_FIELD_NUMBER = 6;
421  private com.google.ortools.sat.PartialVariableAssignment solutionHint_;
437  public boolean hasSolutionHint() {
438  return solutionHint_ != null;
439  }
455  public com.google.ortools.sat.PartialVariableAssignment getSolutionHint() {
456  return solutionHint_ == null ? com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
457  }
473  public com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder() {
474  return getSolutionHint();
475  }
476 
477  private byte memoizedIsInitialized = -1;
478  @java.lang.Override
479  public final boolean isInitialized() {
480  byte isInitialized = memoizedIsInitialized;
481  if (isInitialized == 1) return true;
482  if (isInitialized == 0) return false;
483 
484  memoizedIsInitialized = 1;
485  return true;
486  }
487 
488  @java.lang.Override
489  public void writeTo(com.google.protobuf.CodedOutputStream output)
490  throws java.io.IOException {
491  if (!getNameBytes().isEmpty()) {
492  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
493  }
494  for (int i = 0; i < variables_.size(); i++) {
495  output.writeMessage(2, variables_.get(i));
496  }
497  for (int i = 0; i < constraints_.size(); i++) {
498  output.writeMessage(3, constraints_.get(i));
499  }
500  if (objective_ != null) {
501  output.writeMessage(4, getObjective());
502  }
503  for (int i = 0; i < searchStrategy_.size(); i++) {
504  output.writeMessage(5, searchStrategy_.get(i));
505  }
506  if (solutionHint_ != null) {
507  output.writeMessage(6, getSolutionHint());
508  }
509  unknownFields.writeTo(output);
510  }
511 
512  @java.lang.Override
513  public int getSerializedSize() {
514  int size = memoizedSize;
515  if (size != -1) return size;
516 
517  size = 0;
518  if (!getNameBytes().isEmpty()) {
519  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
520  }
521  for (int i = 0; i < variables_.size(); i++) {
522  size += com.google.protobuf.CodedOutputStream
523  .computeMessageSize(2, variables_.get(i));
524  }
525  for (int i = 0; i < constraints_.size(); i++) {
526  size += com.google.protobuf.CodedOutputStream
527  .computeMessageSize(3, constraints_.get(i));
528  }
529  if (objective_ != null) {
530  size += com.google.protobuf.CodedOutputStream
531  .computeMessageSize(4, getObjective());
532  }
533  for (int i = 0; i < searchStrategy_.size(); i++) {
534  size += com.google.protobuf.CodedOutputStream
535  .computeMessageSize(5, searchStrategy_.get(i));
536  }
537  if (solutionHint_ != null) {
538  size += com.google.protobuf.CodedOutputStream
539  .computeMessageSize(6, getSolutionHint());
540  }
541  size += unknownFields.getSerializedSize();
542  memoizedSize = size;
543  return size;
544  }
545 
546  @java.lang.Override
547  public boolean equals(final java.lang.Object obj) {
548  if (obj == this) {
549  return true;
550  }
551  if (!(obj instanceof com.google.ortools.sat.CpModelProto)) {
552  return super.equals(obj);
553  }
555 
556  if (!getName()
557  .equals(other.getName())) return false;
558  if (!getVariablesList()
559  .equals(other.getVariablesList())) return false;
560  if (!getConstraintsList()
561  .equals(other.getConstraintsList())) return false;
562  if (hasObjective() != other.hasObjective()) return false;
563  if (hasObjective()) {
564  if (!getObjective()
565  .equals(other.getObjective())) return false;
566  }
567  if (!getSearchStrategyList()
568  .equals(other.getSearchStrategyList())) return false;
569  if (hasSolutionHint() != other.hasSolutionHint()) return false;
570  if (hasSolutionHint()) {
571  if (!getSolutionHint()
572  .equals(other.getSolutionHint())) return false;
573  }
574  if (!unknownFields.equals(other.unknownFields)) return false;
575  return true;
576  }
577 
578  @java.lang.Override
579  public int hashCode() {
580  if (memoizedHashCode != 0) {
581  return memoizedHashCode;
582  }
583  int hash = 41;
584  hash = (19 * hash) + getDescriptor().hashCode();
585  hash = (37 * hash) + NAME_FIELD_NUMBER;
586  hash = (53 * hash) + getName().hashCode();
587  if (getVariablesCount() > 0) {
588  hash = (37 * hash) + VARIABLES_FIELD_NUMBER;
589  hash = (53 * hash) + getVariablesList().hashCode();
590  }
591  if (getConstraintsCount() > 0) {
592  hash = (37 * hash) + CONSTRAINTS_FIELD_NUMBER;
593  hash = (53 * hash) + getConstraintsList().hashCode();
594  }
595  if (hasObjective()) {
596  hash = (37 * hash) + OBJECTIVE_FIELD_NUMBER;
597  hash = (53 * hash) + getObjective().hashCode();
598  }
599  if (getSearchStrategyCount() > 0) {
600  hash = (37 * hash) + SEARCH_STRATEGY_FIELD_NUMBER;
601  hash = (53 * hash) + getSearchStrategyList().hashCode();
602  }
603  if (hasSolutionHint()) {
604  hash = (37 * hash) + SOLUTION_HINT_FIELD_NUMBER;
605  hash = (53 * hash) + getSolutionHint().hashCode();
606  }
607  hash = (29 * hash) + unknownFields.hashCode();
608  memoizedHashCode = hash;
609  return hash;
610  }
611 
613  java.nio.ByteBuffer data)
614  throws com.google.protobuf.InvalidProtocolBufferException {
615  return PARSER.parseFrom(data);
616  }
618  java.nio.ByteBuffer data,
619  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
620  throws com.google.protobuf.InvalidProtocolBufferException {
621  return PARSER.parseFrom(data, extensionRegistry);
622  }
624  com.google.protobuf.ByteString data)
625  throws com.google.protobuf.InvalidProtocolBufferException {
626  return PARSER.parseFrom(data);
627  }
629  com.google.protobuf.ByteString data,
630  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
631  throws com.google.protobuf.InvalidProtocolBufferException {
632  return PARSER.parseFrom(data, extensionRegistry);
633  }
634  public static com.google.ortools.sat.CpModelProto parseFrom(byte[] data)
635  throws com.google.protobuf.InvalidProtocolBufferException {
636  return PARSER.parseFrom(data);
637  }
639  byte[] data,
640  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
641  throws com.google.protobuf.InvalidProtocolBufferException {
642  return PARSER.parseFrom(data, extensionRegistry);
643  }
644  public static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input)
645  throws java.io.IOException {
646  return com.google.protobuf.GeneratedMessageV3
647  .parseWithIOException(PARSER, input);
648  }
650  java.io.InputStream input,
651  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
652  throws java.io.IOException {
653  return com.google.protobuf.GeneratedMessageV3
654  .parseWithIOException(PARSER, input, extensionRegistry);
655  }
656  public static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input)
657  throws java.io.IOException {
658  return com.google.protobuf.GeneratedMessageV3
659  .parseDelimitedWithIOException(PARSER, input);
660  }
662  java.io.InputStream input,
663  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
664  throws java.io.IOException {
665  return com.google.protobuf.GeneratedMessageV3
666  .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
667  }
669  com.google.protobuf.CodedInputStream input)
670  throws java.io.IOException {
671  return com.google.protobuf.GeneratedMessageV3
672  .parseWithIOException(PARSER, input);
673  }
675  com.google.protobuf.CodedInputStream input,
676  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
677  throws java.io.IOException {
678  return com.google.protobuf.GeneratedMessageV3
679  .parseWithIOException(PARSER, input, extensionRegistry);
680  }
681 
682  @java.lang.Override
683  public Builder newBuilderForType() { return newBuilder(); }
684  public static Builder newBuilder() {
685  return DEFAULT_INSTANCE.toBuilder();
686  }
687  public static Builder newBuilder(com.google.ortools.sat.CpModelProto prototype) {
688  return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
689  }
690  @java.lang.Override
691  public Builder toBuilder() {
692  return this == DEFAULT_INSTANCE
693  ? new Builder() : new Builder().mergeFrom(this);
694  }
695 
696  @java.lang.Override
698  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
699  Builder builder = new Builder(parent);
700  return builder;
701  }
709  public static final class Builder extends
710  com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
711  // @@protoc_insertion_point(builder_implements:operations_research.sat.CpModelProto)
712  com.google.ortools.sat.CpModelProtoOrBuilder {
713  public static final com.google.protobuf.Descriptors.Descriptor
715  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
716  }
717 
718  @java.lang.Override
719  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
721  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_fieldAccessorTable
722  .ensureFieldAccessorsInitialized(
724  }
725 
726  // Construct using com.google.ortools.sat.CpModelProto.newBuilder()
727  private Builder() {
728  maybeForceBuilderInitialization();
729  }
730 
731  private Builder(
732  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
733  super(parent);
734  maybeForceBuilderInitialization();
735  }
736  private void maybeForceBuilderInitialization() {
737  if (com.google.protobuf.GeneratedMessageV3
738  .alwaysUseFieldBuilders) {
739  getVariablesFieldBuilder();
740  getConstraintsFieldBuilder();
741  getSearchStrategyFieldBuilder();
742  }
743  }
744  @java.lang.Override
745  public Builder clear() {
746  super.clear();
747  name_ = "";
748 
749  if (variablesBuilder_ == null) {
750  variables_ = java.util.Collections.emptyList();
751  bitField0_ = (bitField0_ & ~0x00000001);
752  } else {
753  variablesBuilder_.clear();
754  }
755  if (constraintsBuilder_ == null) {
756  constraints_ = java.util.Collections.emptyList();
757  bitField0_ = (bitField0_ & ~0x00000002);
758  } else {
759  constraintsBuilder_.clear();
760  }
761  if (objectiveBuilder_ == null) {
762  objective_ = null;
763  } else {
764  objective_ = null;
765  objectiveBuilder_ = null;
766  }
767  if (searchStrategyBuilder_ == null) {
768  searchStrategy_ = java.util.Collections.emptyList();
769  bitField0_ = (bitField0_ & ~0x00000004);
770  } else {
771  searchStrategyBuilder_.clear();
772  }
773  if (solutionHintBuilder_ == null) {
774  solutionHint_ = null;
775  } else {
776  solutionHint_ = null;
777  solutionHintBuilder_ = null;
778  }
779  return this;
780  }
781 
782  @java.lang.Override
783  public com.google.protobuf.Descriptors.Descriptor
785  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
786  }
787 
788  @java.lang.Override
791  }
792 
793  @java.lang.Override
796  if (!result.isInitialized()) {
797  throw newUninitializedMessageException(result);
798  }
799  return result;
800  }
801 
802  @java.lang.Override
805  int from_bitField0_ = bitField0_;
806  result.name_ = name_;
807  if (variablesBuilder_ == null) {
808  if (((bitField0_ & 0x00000001) != 0)) {
809  variables_ = java.util.Collections.unmodifiableList(variables_);
810  bitField0_ = (bitField0_ & ~0x00000001);
811  }
812  result.variables_ = variables_;
813  } else {
814  result.variables_ = variablesBuilder_.build();
815  }
816  if (constraintsBuilder_ == null) {
817  if (((bitField0_ & 0x00000002) != 0)) {
818  constraints_ = java.util.Collections.unmodifiableList(constraints_);
819  bitField0_ = (bitField0_ & ~0x00000002);
820  }
821  result.constraints_ = constraints_;
822  } else {
823  result.constraints_ = constraintsBuilder_.build();
824  }
825  if (objectiveBuilder_ == null) {
826  result.objective_ = objective_;
827  } else {
828  result.objective_ = objectiveBuilder_.build();
829  }
830  if (searchStrategyBuilder_ == null) {
831  if (((bitField0_ & 0x00000004) != 0)) {
832  searchStrategy_ = java.util.Collections.unmodifiableList(searchStrategy_);
833  bitField0_ = (bitField0_ & ~0x00000004);
834  }
835  result.searchStrategy_ = searchStrategy_;
836  } else {
837  result.searchStrategy_ = searchStrategyBuilder_.build();
838  }
839  if (solutionHintBuilder_ == null) {
840  result.solutionHint_ = solutionHint_;
841  } else {
842  result.solutionHint_ = solutionHintBuilder_.build();
843  }
844  onBuilt();
845  return result;
846  }
847 
848  @java.lang.Override
849  public Builder clone() {
850  return super.clone();
851  }
852  @java.lang.Override
854  com.google.protobuf.Descriptors.FieldDescriptor field,
855  java.lang.Object value) {
856  return super.setField(field, value);
857  }
858  @java.lang.Override
860  com.google.protobuf.Descriptors.FieldDescriptor field) {
861  return super.clearField(field);
862  }
863  @java.lang.Override
865  com.google.protobuf.Descriptors.OneofDescriptor oneof) {
866  return super.clearOneof(oneof);
867  }
868  @java.lang.Override
870  com.google.protobuf.Descriptors.FieldDescriptor field,
871  int index, java.lang.Object value) {
872  return super.setRepeatedField(field, index, value);
873  }
874  @java.lang.Override
876  com.google.protobuf.Descriptors.FieldDescriptor field,
877  java.lang.Object value) {
878  return super.addRepeatedField(field, value);
879  }
880  @java.lang.Override
881  public Builder mergeFrom(com.google.protobuf.Message other) {
882  if (other instanceof com.google.ortools.sat.CpModelProto) {
883  return mergeFrom((com.google.ortools.sat.CpModelProto)other);
884  } else {
885  super.mergeFrom(other);
886  return this;
887  }
888  }
889 
891  if (other == com.google.ortools.sat.CpModelProto.getDefaultInstance()) return this;
892  if (!other.getName().isEmpty()) {
893  name_ = other.name_;
894  onChanged();
895  }
896  if (variablesBuilder_ == null) {
897  if (!other.variables_.isEmpty()) {
898  if (variables_.isEmpty()) {
899  variables_ = other.variables_;
900  bitField0_ = (bitField0_ & ~0x00000001);
901  } else {
902  ensureVariablesIsMutable();
903  variables_.addAll(other.variables_);
904  }
905  onChanged();
906  }
907  } else {
908  if (!other.variables_.isEmpty()) {
909  if (variablesBuilder_.isEmpty()) {
910  variablesBuilder_.dispose();
911  variablesBuilder_ = null;
912  variables_ = other.variables_;
913  bitField0_ = (bitField0_ & ~0x00000001);
914  variablesBuilder_ =
915  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
916  getVariablesFieldBuilder() : null;
917  } else {
918  variablesBuilder_.addAllMessages(other.variables_);
919  }
920  }
921  }
922  if (constraintsBuilder_ == null) {
923  if (!other.constraints_.isEmpty()) {
924  if (constraints_.isEmpty()) {
925  constraints_ = other.constraints_;
926  bitField0_ = (bitField0_ & ~0x00000002);
927  } else {
928  ensureConstraintsIsMutable();
929  constraints_.addAll(other.constraints_);
930  }
931  onChanged();
932  }
933  } else {
934  if (!other.constraints_.isEmpty()) {
935  if (constraintsBuilder_.isEmpty()) {
936  constraintsBuilder_.dispose();
937  constraintsBuilder_ = null;
938  constraints_ = other.constraints_;
939  bitField0_ = (bitField0_ & ~0x00000002);
940  constraintsBuilder_ =
941  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
942  getConstraintsFieldBuilder() : null;
943  } else {
944  constraintsBuilder_.addAllMessages(other.constraints_);
945  }
946  }
947  }
948  if (other.hasObjective()) {
949  mergeObjective(other.getObjective());
950  }
951  if (searchStrategyBuilder_ == null) {
952  if (!other.searchStrategy_.isEmpty()) {
953  if (searchStrategy_.isEmpty()) {
954  searchStrategy_ = other.searchStrategy_;
955  bitField0_ = (bitField0_ & ~0x00000004);
956  } else {
957  ensureSearchStrategyIsMutable();
958  searchStrategy_.addAll(other.searchStrategy_);
959  }
960  onChanged();
961  }
962  } else {
963  if (!other.searchStrategy_.isEmpty()) {
964  if (searchStrategyBuilder_.isEmpty()) {
965  searchStrategyBuilder_.dispose();
966  searchStrategyBuilder_ = null;
967  searchStrategy_ = other.searchStrategy_;
968  bitField0_ = (bitField0_ & ~0x00000004);
969  searchStrategyBuilder_ =
970  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
971  getSearchStrategyFieldBuilder() : null;
972  } else {
973  searchStrategyBuilder_.addAllMessages(other.searchStrategy_);
974  }
975  }
976  }
977  if (other.hasSolutionHint()) {
978  mergeSolutionHint(other.getSolutionHint());
979  }
980  this.mergeUnknownFields(other.unknownFields);
981  onChanged();
982  return this;
983  }
984 
985  @java.lang.Override
986  public final boolean isInitialized() {
987  return true;
988  }
989 
990  @java.lang.Override
992  com.google.protobuf.CodedInputStream input,
993  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
994  throws java.io.IOException {
995  com.google.ortools.sat.CpModelProto parsedMessage = null;
996  try {
997  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
998  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
999  parsedMessage = (com.google.ortools.sat.CpModelProto) e.getUnfinishedMessage();
1000  throw e.unwrapIOException();
1001  } finally {
1002  if (parsedMessage != null) {
1003  mergeFrom(parsedMessage);
1004  }
1005  }
1006  return this;
1007  }
1008  private int bitField0_;
1009 
1010  private java.lang.Object name_ = "";
1018  public java.lang.String getName() {
1019  java.lang.Object ref = name_;
1020  if (!(ref instanceof java.lang.String)) {
1021  com.google.protobuf.ByteString bs =
1022  (com.google.protobuf.ByteString) ref;
1023  java.lang.String s = bs.toStringUtf8();
1024  name_ = s;
1025  return s;
1026  } else {
1027  return (java.lang.String) ref;
1028  }
1029  }
1037  public com.google.protobuf.ByteString
1039  java.lang.Object ref = name_;
1040  if (ref instanceof String) {
1041  com.google.protobuf.ByteString b =
1042  com.google.protobuf.ByteString.copyFromUtf8(
1043  (java.lang.String) ref);
1044  name_ = b;
1045  return b;
1046  } else {
1047  return (com.google.protobuf.ByteString) ref;
1048  }
1049  }
1058  java.lang.String value) {
1059  if (value == null) {
1060  throw new NullPointerException();
1061  }
1062 
1063  name_ = value;
1064  onChanged();
1065  return this;
1066  }
1074  public Builder clearName() {
1075 
1076  name_ = getDefaultInstance().getName();
1077  onChanged();
1078  return this;
1079  }
1088  com.google.protobuf.ByteString value) {
1089  if (value == null) {
1090  throw new NullPointerException();
1091  }
1092  checkByteStringIsUtf8(value);
1093 
1094  name_ = value;
1095  onChanged();
1096  return this;
1097  }
1098 
1099  private java.util.List<com.google.ortools.sat.IntegerVariableProto> variables_ =
1100  java.util.Collections.emptyList();
1101  private void ensureVariablesIsMutable() {
1102  if (!((bitField0_ & 0x00000001) != 0)) {
1103  variables_ = new java.util.ArrayList<com.google.ortools.sat.IntegerVariableProto>(variables_);
1104  bitField0_ |= 0x00000001;
1105  }
1106  }
1107 
1108  private com.google.protobuf.RepeatedFieldBuilderV3<
1109  com.google.ortools.sat.IntegerVariableProto, com.google.ortools.sat.IntegerVariableProto.Builder, com.google.ortools.sat.IntegerVariableProtoOrBuilder> variablesBuilder_;
1110 
1119  if (variablesBuilder_ == null) {
1120  return java.util.Collections.unmodifiableList(variables_);
1121  } else {
1122  return variablesBuilder_.getMessageList();
1123  }
1124  }
1132  public int getVariablesCount() {
1133  if (variablesBuilder_ == null) {
1134  return variables_.size();
1135  } else {
1136  return variablesBuilder_.getCount();
1137  }
1138  }
1147  if (variablesBuilder_ == null) {
1148  return variables_.get(index);
1149  } else {
1150  return variablesBuilder_.getMessage(index);
1151  }
1152  }
1161  int index, com.google.ortools.sat.IntegerVariableProto value) {
1162  if (variablesBuilder_ == null) {
1163  if (value == null) {
1164  throw new NullPointerException();
1165  }
1166  ensureVariablesIsMutable();
1167  variables_.set(index, value);
1168  onChanged();
1169  } else {
1170  variablesBuilder_.setMessage(index, value);
1171  }
1172  return this;
1173  }
1182  int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1183  if (variablesBuilder_ == null) {
1184  ensureVariablesIsMutable();
1185  variables_.set(index, builderForValue.build());
1186  onChanged();
1187  } else {
1188  variablesBuilder_.setMessage(index, builderForValue.build());
1189  }
1190  return this;
1191  }
1200  if (variablesBuilder_ == null) {
1201  if (value == null) {
1202  throw new NullPointerException();
1203  }
1204  ensureVariablesIsMutable();
1205  variables_.add(value);
1206  onChanged();
1207  } else {
1208  variablesBuilder_.addMessage(value);
1209  }
1210  return this;
1211  }
1220  int index, com.google.ortools.sat.IntegerVariableProto value) {
1221  if (variablesBuilder_ == null) {
1222  if (value == null) {
1223  throw new NullPointerException();
1224  }
1225  ensureVariablesIsMutable();
1226  variables_.add(index, value);
1227  onChanged();
1228  } else {
1229  variablesBuilder_.addMessage(index, value);
1230  }
1231  return this;
1232  }
1241  com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1242  if (variablesBuilder_ == null) {
1243  ensureVariablesIsMutable();
1244  variables_.add(builderForValue.build());
1245  onChanged();
1246  } else {
1247  variablesBuilder_.addMessage(builderForValue.build());
1248  }
1249  return this;
1250  }
1259  int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1260  if (variablesBuilder_ == null) {
1261  ensureVariablesIsMutable();
1262  variables_.add(index, builderForValue.build());
1263  onChanged();
1264  } else {
1265  variablesBuilder_.addMessage(index, builderForValue.build());
1266  }
1267  return this;
1268  }
1277  java.lang.Iterable<? extends com.google.ortools.sat.IntegerVariableProto> values) {
1278  if (variablesBuilder_ == null) {
1279  ensureVariablesIsMutable();
1280  com.google.protobuf.AbstractMessageLite.Builder.addAll(
1281  values, variables_);
1282  onChanged();
1283  } else {
1284  variablesBuilder_.addAllMessages(values);
1285  }
1286  return this;
1287  }
1296  if (variablesBuilder_ == null) {
1297  variables_ = java.util.Collections.emptyList();
1298  bitField0_ = (bitField0_ & ~0x00000001);
1299  onChanged();
1300  } else {
1301  variablesBuilder_.clear();
1302  }
1303  return this;
1304  }
1312  public Builder removeVariables(int index) {
1313  if (variablesBuilder_ == null) {
1314  ensureVariablesIsMutable();
1315  variables_.remove(index);
1316  onChanged();
1317  } else {
1318  variablesBuilder_.remove(index);
1319  }
1320  return this;
1321  }
1330  int index) {
1331  return getVariablesFieldBuilder().getBuilder(index);
1332  }
1340  public com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(
1341  int index) {
1342  if (variablesBuilder_ == null) {
1343  return variables_.get(index); } else {
1344  return variablesBuilder_.getMessageOrBuilder(index);
1345  }
1346  }
1354  public java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder>
1356  if (variablesBuilder_ != null) {
1357  return variablesBuilder_.getMessageOrBuilderList();
1358  } else {
1359  return java.util.Collections.unmodifiableList(variables_);
1360  }
1361  }
1370  return getVariablesFieldBuilder().addBuilder(
1371  com.google.ortools.sat.IntegerVariableProto.getDefaultInstance());
1372  }
1381  int index) {
1382  return getVariablesFieldBuilder().addBuilder(
1383  index, com.google.ortools.sat.IntegerVariableProto.getDefaultInstance());
1384  }
1392  public java.util.List<com.google.ortools.sat.IntegerVariableProto.Builder>
1394  return getVariablesFieldBuilder().getBuilderList();
1395  }
1396  private com.google.protobuf.RepeatedFieldBuilderV3<
1398  getVariablesFieldBuilder() {
1399  if (variablesBuilder_ == null) {
1400  variablesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1402  variables_,
1403  ((bitField0_ & 0x00000001) != 0),
1404  getParentForChildren(),
1405  isClean());
1406  variables_ = null;
1407  }
1408  return variablesBuilder_;
1409  }
1410 
1411  private java.util.List<com.google.ortools.sat.ConstraintProto> constraints_ =
1412  java.util.Collections.emptyList();
1413  private void ensureConstraintsIsMutable() {
1414  if (!((bitField0_ & 0x00000002) != 0)) {
1415  constraints_ = new java.util.ArrayList<com.google.ortools.sat.ConstraintProto>(constraints_);
1416  bitField0_ |= 0x00000002;
1417  }
1418  }
1419 
1420  private com.google.protobuf.RepeatedFieldBuilderV3<
1421  com.google.ortools.sat.ConstraintProto, com.google.ortools.sat.ConstraintProto.Builder, com.google.ortools.sat.ConstraintProtoOrBuilder> constraintsBuilder_;
1422 
1427  if (constraintsBuilder_ == null) {
1428  return java.util.Collections.unmodifiableList(constraints_);
1429  } else {
1430  return constraintsBuilder_.getMessageList();
1431  }
1432  }
1436  public int getConstraintsCount() {
1437  if (constraintsBuilder_ == null) {
1438  return constraints_.size();
1439  } else {
1440  return constraintsBuilder_.getCount();
1441  }
1442  }
1447  if (constraintsBuilder_ == null) {
1448  return constraints_.get(index);
1449  } else {
1450  return constraintsBuilder_.getMessage(index);
1451  }
1452  }
1457  int index, com.google.ortools.sat.ConstraintProto value) {
1458  if (constraintsBuilder_ == null) {
1459  if (value == null) {
1460  throw new NullPointerException();
1461  }
1462  ensureConstraintsIsMutable();
1463  constraints_.set(index, value);
1464  onChanged();
1465  } else {
1466  constraintsBuilder_.setMessage(index, value);
1467  }
1468  return this;
1469  }
1474  int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1475  if (constraintsBuilder_ == null) {
1476  ensureConstraintsIsMutable();
1477  constraints_.set(index, builderForValue.build());
1478  onChanged();
1479  } else {
1480  constraintsBuilder_.setMessage(index, builderForValue.build());
1481  }
1482  return this;
1483  }
1488  if (constraintsBuilder_ == null) {
1489  if (value == null) {
1490  throw new NullPointerException();
1491  }
1492  ensureConstraintsIsMutable();
1493  constraints_.add(value);
1494  onChanged();
1495  } else {
1496  constraintsBuilder_.addMessage(value);
1497  }
1498  return this;
1499  }
1504  int index, com.google.ortools.sat.ConstraintProto value) {
1505  if (constraintsBuilder_ == null) {
1506  if (value == null) {
1507  throw new NullPointerException();
1508  }
1509  ensureConstraintsIsMutable();
1510  constraints_.add(index, value);
1511  onChanged();
1512  } else {
1513  constraintsBuilder_.addMessage(index, value);
1514  }
1515  return this;
1516  }
1521  com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1522  if (constraintsBuilder_ == null) {
1523  ensureConstraintsIsMutable();
1524  constraints_.add(builderForValue.build());
1525  onChanged();
1526  } else {
1527  constraintsBuilder_.addMessage(builderForValue.build());
1528  }
1529  return this;
1530  }
1535  int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1536  if (constraintsBuilder_ == null) {
1537  ensureConstraintsIsMutable();
1538  constraints_.add(index, builderForValue.build());
1539  onChanged();
1540  } else {
1541  constraintsBuilder_.addMessage(index, builderForValue.build());
1542  }
1543  return this;
1544  }
1549  java.lang.Iterable<? extends com.google.ortools.sat.ConstraintProto> values) {
1550  if (constraintsBuilder_ == null) {
1551  ensureConstraintsIsMutable();
1552  com.google.protobuf.AbstractMessageLite.Builder.addAll(
1553  values, constraints_);
1554  onChanged();
1555  } else {
1556  constraintsBuilder_.addAllMessages(values);
1557  }
1558  return this;
1559  }
1564  if (constraintsBuilder_ == null) {
1565  constraints_ = java.util.Collections.emptyList();
1566  bitField0_ = (bitField0_ & ~0x00000002);
1567  onChanged();
1568  } else {
1569  constraintsBuilder_.clear();
1570  }
1571  return this;
1572  }
1576  public Builder removeConstraints(int index) {
1577  if (constraintsBuilder_ == null) {
1578  ensureConstraintsIsMutable();
1579  constraints_.remove(index);
1580  onChanged();
1581  } else {
1582  constraintsBuilder_.remove(index);
1583  }
1584  return this;
1585  }
1590  int index) {
1591  return getConstraintsFieldBuilder().getBuilder(index);
1592  }
1596  public com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(
1597  int index) {
1598  if (constraintsBuilder_ == null) {
1599  return constraints_.get(index); } else {
1600  return constraintsBuilder_.getMessageOrBuilder(index);
1601  }
1602  }
1606  public java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder>
1608  if (constraintsBuilder_ != null) {
1609  return constraintsBuilder_.getMessageOrBuilderList();
1610  } else {
1611  return java.util.Collections.unmodifiableList(constraints_);
1612  }
1613  }
1618  return getConstraintsFieldBuilder().addBuilder(
1619  com.google.ortools.sat.ConstraintProto.getDefaultInstance());
1620  }
1625  int index) {
1626  return getConstraintsFieldBuilder().addBuilder(
1627  index, com.google.ortools.sat.ConstraintProto.getDefaultInstance());
1628  }
1632  public java.util.List<com.google.ortools.sat.ConstraintProto.Builder>
1634  return getConstraintsFieldBuilder().getBuilderList();
1635  }
1636  private com.google.protobuf.RepeatedFieldBuilderV3<
1637  com.google.ortools.sat.ConstraintProto, com.google.ortools.sat.ConstraintProto.Builder, com.google.ortools.sat.ConstraintProtoOrBuilder>
1638  getConstraintsFieldBuilder() {
1639  if (constraintsBuilder_ == null) {
1640  constraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1641  com.google.ortools.sat.ConstraintProto, com.google.ortools.sat.ConstraintProto.Builder, com.google.ortools.sat.ConstraintProtoOrBuilder>(
1642  constraints_,
1643  ((bitField0_ & 0x00000002) != 0),
1644  getParentForChildren(),
1645  isClean());
1646  constraints_ = null;
1647  }
1648  return constraintsBuilder_;
1649  }
1650 
1651  private com.google.ortools.sat.CpObjectiveProto objective_;
1652  private com.google.protobuf.SingleFieldBuilderV3<
1653  com.google.ortools.sat.CpObjectiveProto, com.google.ortools.sat.CpObjectiveProto.Builder, com.google.ortools.sat.CpObjectiveProtoOrBuilder> objectiveBuilder_;
1661  public boolean hasObjective() {
1662  return objectiveBuilder_ != null || objective_ != null;
1663  }
1672  if (objectiveBuilder_ == null) {
1673  return objective_ == null ? com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
1674  } else {
1675  return objectiveBuilder_.getMessage();
1676  }
1677  }
1686  if (objectiveBuilder_ == null) {
1687  if (value == null) {
1688  throw new NullPointerException();
1689  }
1690  objective_ = value;
1691  onChanged();
1692  } else {
1693  objectiveBuilder_.setMessage(value);
1694  }
1695 
1696  return this;
1697  }
1706  com.google.ortools.sat.CpObjectiveProto.Builder builderForValue) {
1707  if (objectiveBuilder_ == null) {
1708  objective_ = builderForValue.build();
1709  onChanged();
1710  } else {
1711  objectiveBuilder_.setMessage(builderForValue.build());
1712  }
1713 
1714  return this;
1715  }
1724  if (objectiveBuilder_ == null) {
1725  if (objective_ != null) {
1726  objective_ =
1727  com.google.ortools.sat.CpObjectiveProto.newBuilder(objective_).mergeFrom(value).buildPartial();
1728  } else {
1729  objective_ = value;
1730  }
1731  onChanged();
1732  } else {
1733  objectiveBuilder_.mergeFrom(value);
1734  }
1735 
1736  return this;
1737  }
1746  if (objectiveBuilder_ == null) {
1747  objective_ = null;
1748  onChanged();
1749  } else {
1750  objective_ = null;
1751  objectiveBuilder_ = null;
1752  }
1753 
1754  return this;
1755  }
1764 
1765  onChanged();
1766  return getObjectiveFieldBuilder().getBuilder();
1767  }
1775  public com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder() {
1776  if (objectiveBuilder_ != null) {
1777  return objectiveBuilder_.getMessageOrBuilder();
1778  } else {
1779  return objective_ == null ?
1780  com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
1781  }
1782  }
1790  private com.google.protobuf.SingleFieldBuilderV3<
1792  getObjectiveFieldBuilder() {
1793  if (objectiveBuilder_ == null) {
1794  objectiveBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
1796  getObjective(),
1797  getParentForChildren(),
1798  isClean());
1799  objective_ = null;
1800  }
1801  return objectiveBuilder_;
1802  }
1803 
1804  private java.util.List<com.google.ortools.sat.DecisionStrategyProto> searchStrategy_ =
1805  java.util.Collections.emptyList();
1806  private void ensureSearchStrategyIsMutable() {
1807  if (!((bitField0_ & 0x00000004) != 0)) {
1808  searchStrategy_ = new java.util.ArrayList<com.google.ortools.sat.DecisionStrategyProto>(searchStrategy_);
1809  bitField0_ |= 0x00000004;
1810  }
1811  }
1812 
1813  private com.google.protobuf.RepeatedFieldBuilderV3<
1814  com.google.ortools.sat.DecisionStrategyProto, com.google.ortools.sat.DecisionStrategyProto.Builder, com.google.ortools.sat.DecisionStrategyProtoOrBuilder> searchStrategyBuilder_;
1815 
1832  if (searchStrategyBuilder_ == null) {
1833  return java.util.Collections.unmodifiableList(searchStrategy_);
1834  } else {
1835  return searchStrategyBuilder_.getMessageList();
1836  }
1837  }
1853  public int getSearchStrategyCount() {
1854  if (searchStrategyBuilder_ == null) {
1855  return searchStrategy_.size();
1856  } else {
1857  return searchStrategyBuilder_.getCount();
1858  }
1859  }
1876  if (searchStrategyBuilder_ == null) {
1877  return searchStrategy_.get(index);
1878  } else {
1879  return searchStrategyBuilder_.getMessage(index);
1880  }
1881  }
1898  int index, com.google.ortools.sat.DecisionStrategyProto value) {
1899  if (searchStrategyBuilder_ == null) {
1900  if (value == null) {
1901  throw new NullPointerException();
1902  }
1903  ensureSearchStrategyIsMutable();
1904  searchStrategy_.set(index, value);
1905  onChanged();
1906  } else {
1907  searchStrategyBuilder_.setMessage(index, value);
1908  }
1909  return this;
1910  }
1927  int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
1928  if (searchStrategyBuilder_ == null) {
1929  ensureSearchStrategyIsMutable();
1930  searchStrategy_.set(index, builderForValue.build());
1931  onChanged();
1932  } else {
1933  searchStrategyBuilder_.setMessage(index, builderForValue.build());
1934  }
1935  return this;
1936  }
1953  if (searchStrategyBuilder_ == null) {
1954  if (value == null) {
1955  throw new NullPointerException();
1956  }
1957  ensureSearchStrategyIsMutable();
1958  searchStrategy_.add(value);
1959  onChanged();
1960  } else {
1961  searchStrategyBuilder_.addMessage(value);
1962  }
1963  return this;
1964  }
1981  int index, com.google.ortools.sat.DecisionStrategyProto value) {
1982  if (searchStrategyBuilder_ == null) {
1983  if (value == null) {
1984  throw new NullPointerException();
1985  }
1986  ensureSearchStrategyIsMutable();
1987  searchStrategy_.add(index, value);
1988  onChanged();
1989  } else {
1990  searchStrategyBuilder_.addMessage(index, value);
1991  }
1992  return this;
1993  }
2010  com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
2011  if (searchStrategyBuilder_ == null) {
2012  ensureSearchStrategyIsMutable();
2013  searchStrategy_.add(builderForValue.build());
2014  onChanged();
2015  } else {
2016  searchStrategyBuilder_.addMessage(builderForValue.build());
2017  }
2018  return this;
2019  }
2036  int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
2037  if (searchStrategyBuilder_ == null) {
2038  ensureSearchStrategyIsMutable();
2039  searchStrategy_.add(index, builderForValue.build());
2040  onChanged();
2041  } else {
2042  searchStrategyBuilder_.addMessage(index, builderForValue.build());
2043  }
2044  return this;
2045  }
2062  java.lang.Iterable<? extends com.google.ortools.sat.DecisionStrategyProto> values) {
2063  if (searchStrategyBuilder_ == null) {
2064  ensureSearchStrategyIsMutable();
2065  com.google.protobuf.AbstractMessageLite.Builder.addAll(
2066  values, searchStrategy_);
2067  onChanged();
2068  } else {
2069  searchStrategyBuilder_.addAllMessages(values);
2070  }
2071  return this;
2072  }
2089  if (searchStrategyBuilder_ == null) {
2090  searchStrategy_ = java.util.Collections.emptyList();
2091  bitField0_ = (bitField0_ & ~0x00000004);
2092  onChanged();
2093  } else {
2094  searchStrategyBuilder_.clear();
2095  }
2096  return this;
2097  }
2113  public Builder removeSearchStrategy(int index) {
2114  if (searchStrategyBuilder_ == null) {
2115  ensureSearchStrategyIsMutable();
2116  searchStrategy_.remove(index);
2117  onChanged();
2118  } else {
2119  searchStrategyBuilder_.remove(index);
2120  }
2121  return this;
2122  }
2139  int index) {
2140  return getSearchStrategyFieldBuilder().getBuilder(index);
2141  }
2157  public com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(
2158  int index) {
2159  if (searchStrategyBuilder_ == null) {
2160  return searchStrategy_.get(index); } else {
2161  return searchStrategyBuilder_.getMessageOrBuilder(index);
2162  }
2163  }
2179  public java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
2181  if (searchStrategyBuilder_ != null) {
2182  return searchStrategyBuilder_.getMessageOrBuilderList();
2183  } else {
2184  return java.util.Collections.unmodifiableList(searchStrategy_);
2185  }
2186  }
2203  return getSearchStrategyFieldBuilder().addBuilder(
2204  com.google.ortools.sat.DecisionStrategyProto.getDefaultInstance());
2205  }
2222  int index) {
2223  return getSearchStrategyFieldBuilder().addBuilder(
2224  index, com.google.ortools.sat.DecisionStrategyProto.getDefaultInstance());
2225  }
2241  public java.util.List<com.google.ortools.sat.DecisionStrategyProto.Builder>
2243  return getSearchStrategyFieldBuilder().getBuilderList();
2244  }
2245  private com.google.protobuf.RepeatedFieldBuilderV3<
2247  getSearchStrategyFieldBuilder() {
2248  if (searchStrategyBuilder_ == null) {
2249  searchStrategyBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
2251  searchStrategy_,
2252  ((bitField0_ & 0x00000004) != 0),
2253  getParentForChildren(),
2254  isClean());
2255  searchStrategy_ = null;
2256  }
2257  return searchStrategyBuilder_;
2258  }
2259 
2260  private com.google.ortools.sat.PartialVariableAssignment solutionHint_;
2261  private com.google.protobuf.SingleFieldBuilderV3<
2262  com.google.ortools.sat.PartialVariableAssignment, com.google.ortools.sat.PartialVariableAssignment.Builder, com.google.ortools.sat.PartialVariableAssignmentOrBuilder> solutionHintBuilder_;
2278  public boolean hasSolutionHint() {
2279  return solutionHintBuilder_ != null || solutionHint_ != null;
2280  }
2296  public com.google.ortools.sat.PartialVariableAssignment getSolutionHint() {
2297  if (solutionHintBuilder_ == null) {
2298  return solutionHint_ == null ? com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
2299  } else {
2300  return solutionHintBuilder_.getMessage();
2301  }
2302  }
2318  public Builder setSolutionHint(com.google.ortools.sat.PartialVariableAssignment value) {
2319  if (solutionHintBuilder_ == null) {
2320  if (value == null) {
2321  throw new NullPointerException();
2322  }
2323  solutionHint_ = value;
2324  onChanged();
2325  } else {
2326  solutionHintBuilder_.setMessage(value);
2327  }
2328 
2329  return this;
2330  }
2347  com.google.ortools.sat.PartialVariableAssignment.Builder builderForValue) {
2348  if (solutionHintBuilder_ == null) {
2349  solutionHint_ = builderForValue.build();
2350  onChanged();
2351  } else {
2352  solutionHintBuilder_.setMessage(builderForValue.build());
2353  }
2354 
2355  return this;
2356  }
2372  public Builder mergeSolutionHint(com.google.ortools.sat.PartialVariableAssignment value) {
2373  if (solutionHintBuilder_ == null) {
2374  if (solutionHint_ != null) {
2375  solutionHint_ =
2376  com.google.ortools.sat.PartialVariableAssignment.newBuilder(solutionHint_).mergeFrom(value).buildPartial();
2377  } else {
2378  solutionHint_ = value;
2379  }
2380  onChanged();
2381  } else {
2382  solutionHintBuilder_.mergeFrom(value);
2383  }
2384 
2385  return this;
2386  }
2403  if (solutionHintBuilder_ == null) {
2404  solutionHint_ = null;
2405  onChanged();
2406  } else {
2407  solutionHint_ = null;
2408  solutionHintBuilder_ = null;
2409  }
2410 
2411  return this;
2412  }
2428  public com.google.ortools.sat.PartialVariableAssignment.Builder getSolutionHintBuilder() {
2429 
2430  onChanged();
2431  return getSolutionHintFieldBuilder().getBuilder();
2432  }
2448  public com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder() {
2449  if (solutionHintBuilder_ != null) {
2450  return solutionHintBuilder_.getMessageOrBuilder();
2451  } else {
2452  return solutionHint_ == null ?
2453  com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
2454  }
2455  }
2471  private com.google.protobuf.SingleFieldBuilderV3<
2472  com.google.ortools.sat.PartialVariableAssignment, com.google.ortools.sat.PartialVariableAssignment.Builder, com.google.ortools.sat.PartialVariableAssignmentOrBuilder>
2473  getSolutionHintFieldBuilder() {
2474  if (solutionHintBuilder_ == null) {
2475  solutionHintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
2476  com.google.ortools.sat.PartialVariableAssignment, com.google.ortools.sat.PartialVariableAssignment.Builder, com.google.ortools.sat.PartialVariableAssignmentOrBuilder>(
2477  getSolutionHint(),
2478  getParentForChildren(),
2479  isClean());
2480  solutionHint_ = null;
2481  }
2482  return solutionHintBuilder_;
2483  }
2484  @java.lang.Override
2486  final com.google.protobuf.UnknownFieldSet unknownFields) {
2487  return super.setUnknownFields(unknownFields);
2488  }
2489 
2490  @java.lang.Override
2492  final com.google.protobuf.UnknownFieldSet unknownFields) {
2493  return super.mergeUnknownFields(unknownFields);
2494  }
2495 
2496 
2497  // @@protoc_insertion_point(builder_scope:operations_research.sat.CpModelProto)
2498  }
2499 
2500  // @@protoc_insertion_point(class_scope:operations_research.sat.CpModelProto)
2501  private static final com.google.ortools.sat.CpModelProto DEFAULT_INSTANCE;
2502  static {
2503  DEFAULT_INSTANCE = new com.google.ortools.sat.CpModelProto();
2504  }
2505 
2507  return DEFAULT_INSTANCE;
2508  }
2509 
2510  private static final com.google.protobuf.Parser<CpModelProto>
2511  PARSER = new com.google.protobuf.AbstractParser<CpModelProto>() {
2512  @java.lang.Override
2513  public CpModelProto parsePartialFrom(
2514  com.google.protobuf.CodedInputStream input,
2515  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2516  throws com.google.protobuf.InvalidProtocolBufferException {
2517  return new CpModelProto(input, extensionRegistry);
2518  }
2519  };
2520 
2521  public static com.google.protobuf.Parser<CpModelProto> parser() {
2522  return PARSER;
2523  }
2524 
2525  @java.lang.Override
2526  public com.google.protobuf.Parser<CpModelProto> getParserForType() {
2527  return PARSER;
2528  }
2529 
2530  @java.lang.Override
2532  return DEFAULT_INSTANCE;
2533  }
2534 
2535 }
2536 
com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(int index)
static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input)
static com.google.ortools.sat.CpModelProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.ByteString getNameBytes()
Builder addSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto value)
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.CpModelProto getDefaultInstance()
Builder setSolutionHint(com.google.ortools.sat.PartialVariableAssignment value)
com.google.ortools.sat.CpObjectiveProto getObjective()
Builder clearConstraints()
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.PartialVariableAssignment getSolutionHint()
Builder setSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
Builder addVariables(int index, com.google.ortools.sat.IntegerVariableProto value)
Builder addVariables(int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
Builder addVariables(com.google.ortools.sat.IntegerVariableProto value)
static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.util.List< com.google.ortools.sat.ConstraintProto > getConstraintsList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder setSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto value)
com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override final boolean isInitialized()
Builder addConstraints(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()
Builder mergeObjective(com.google.ortools.sat.CpObjectiveProto value)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder setVariables(int index, com.google.ortools.sat.IntegerVariableProto value)
static com.google.ortools.sat.CpModelProto parseFrom(java.nio.ByteBuffer data)
com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(int index)
java.util.List< com.google.ortools.sat.ConstraintProto.Builder > getConstraintsBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.ByteString data)
java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder > getVariablesOrBuilderList()
com.google.ortools.sat.DecisionStrategyProto.Builder addSearchStrategyBuilder(int index)
.lang.Override Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
Builder addConstraints(com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.IntegerVariableProto.Builder getVariablesBuilder(int index)
com.google.ortools.sat.PartialVariableAssignment.Builder getSolutionHintBuilder()
.lang.Override com.google.ortools.sat.CpModelProto buildPartial()
.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;
com.google.ortools.sat.IntegerVariableProto.Builder addVariablesBuilder(int index)
Builder mergeSolutionHint(com.google.ortools.sat.PartialVariableAssignment value)
Builder mergeFrom(com.google.ortools.sat.CpModelProto other)
com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(int index)
Builder addAllVariables(java.lang.Iterable<? extends com.google.ortools.sat.IntegerVariableProto > values)
com.google.ortools.sat.DecisionStrategyProto.Builder getSearchStrategyBuilder(int index)
Builder setConstraints(int index, com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.ConstraintProto.Builder getConstraintsBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
int getConstraintsCount()
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Builder addConstraints(int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.protobuf.Parser< CpModelProto > parser()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder > getConstraintsOrBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder()
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)
.lang.Override java.lang.Object newInstance(UnusedPrivateParameter unused)
.lang.Override final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
.lang.Override Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
com.google.ortools.sat.DecisionStrategyProto getSearchStrategy(int index)
com.google.ortools.sat.DecisionStrategyProto getSearchStrategy(int index)
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.Builder builderForValue)
Builder addConstraints(com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder()
.lang.Override final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
com.google.protobuf.ByteString getNameBytes()
Builder addSearchStrategy(com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
Builder removeConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder > getConstraintsOrBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
com.google.ortools.sat.DecisionStrategyProto.Builder addSearchStrategyBuilder()
Builder addSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
.lang.Override Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
.lang.Override com.google.protobuf.Parser< CpModelProto > getParserForType()
java.util.List< com.google.ortools.sat.IntegerVariableProto > getVariablesList()
.lang.Override int getSerializedSize()
.lang.Override com.google.ortools.sat.CpModelProto build()
java.util.List< com.google.ortools.sat.ConstraintProto > getConstraintsList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.CpObjectiveProto.Builder getObjectiveBuilder()
java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder > getSearchStrategyOrBuilderList()
.lang.Override final com.google.protobuf.UnknownFieldSet getUnknownFields()
.lang.Override void writeTo(com.google.protobuf.CodedOutputStream output)
Builder setVariables(int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
.lang.Override com.google.ortools.sat.CpModelProto getDefaultInstanceForType()
static Builder newBuilder(com.google.ortools.sat.CpModelProto prototype)
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
java.util.List< com.google.ortools.sat.DecisionStrategyProto > getSearchStrategyList()
Builder addSearchStrategy(com.google.ortools.sat.DecisionStrategyProto value)
com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder()
com.google.ortools.sat.ConstraintProto getConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static final int SEARCH_STRATEGY_FIELD_NUMBER
java.util.List< com.google.ortools.sat.IntegerVariableProto > getVariablesList()
.lang.Override Builder newBuilderForType()
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.PartialVariableAssignment getSolutionHint()
com.google.ortools.sat.CpObjectiveProto getObjective()
Builder setSolutionHint(com.google.ortools.sat.PartialVariableAssignment.Builder builderForValue)
Builder addAllSearchStrategy(java.lang.Iterable<? extends com.google.ortools.sat.DecisionStrategyProto > values)
com.google.ortools.sat.IntegerVariableProto getVariables(int index)
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.IntegerVariableProto getVariables(int index)
.lang.Override Builder toBuilder()
java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder > getVariablesOrBuilderList()
.lang.Override Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder setName(java.lang.String value)
com.google.ortools.sat.ConstraintProto getConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.IntegerVariableProto.Builder addVariablesBuilder()
java.util.List< com.google.ortools.sat.DecisionStrategyProto > getSearchStrategyList()
.lang.Override boolean equals(final java.lang.Object obj)
com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder()
java.util.List< com.google.ortools.sat.DecisionStrategyProto.Builder > getSearchStrategyBuilderList()
java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder > getSearchStrategyOrBuilderList()
.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
.lang.Override final boolean isInitialized()
Builder setObjective(com.google.ortools.sat.CpObjectiveProto.Builder builderForValue)
com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(int index)
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.ConstraintProto.Builder addConstraintsBuilder()
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder setNameBytes(com.google.protobuf.ByteString value)
static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input)
.lang.Override com.google.ortools.sat.CpModelProto getDefaultInstanceForType()
Builder setObjective(com.google.ortools.sat.CpObjectiveProto value)