Java Reference

Java Reference

CpModelProto.java
Go to the documentation of this file.
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: ortools/sat/cp_model.proto
3 
4 package com.google.ortools.sat;
5 
13 public final class CpModelProto extends
14  com.google.protobuf.GeneratedMessageV3 implements
15  // @@protoc_insertion_point(message_implements:operations_research.sat.CpModelProto)
17 private static final long serialVersionUID = 0L;
18  // Use CpModelProto.newBuilder() to construct.
19  private CpModelProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
20  super(builder);
21  }
22  private CpModelProto() {
23  name_ = "";
24  variables_ = java.util.Collections.emptyList();
25  constraints_ = java.util.Collections.emptyList();
26  searchStrategy_ = java.util.Collections.emptyList();
27  }
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: {
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_;
170  public java.lang.String getName() {
171  java.lang.Object ref = name_;
172  if (ref instanceof java.lang.String) {
173  return (java.lang.String) ref;
174  } else {
175  com.google.protobuf.ByteString bs =
176  (com.google.protobuf.ByteString) ref;
177  java.lang.String s = bs.toStringUtf8();
178  name_ = s;
179  return s;
180  }
181  }
190  public com.google.protobuf.ByteString
192  java.lang.Object ref = name_;
193  if (ref instanceof java.lang.String) {
194  com.google.protobuf.ByteString b =
195  com.google.protobuf.ByteString.copyFromUtf8(
196  (java.lang.String) ref);
197  name_ = b;
198  return b;
199  } else {
200  return (com.google.protobuf.ByteString) ref;
201  }
202  }
203 
204  public static final int VARIABLES_FIELD_NUMBER = 2;
205  private java.util.List<com.google.ortools.sat.IntegerVariableProto> variables_;
214  return variables_;
215  }
223  public java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder>
225  return variables_;
226  }
234  public int getVariablesCount() {
235  return variables_.size();
236  }
245  return variables_.get(index);
246  }
255  int index) {
256  return variables_.get(index);
257  }
258 
259  public static final int CONSTRAINTS_FIELD_NUMBER = 3;
260  private java.util.List<com.google.ortools.sat.ConstraintProto> constraints_;
265  return constraints_;
266  }
270  public java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder>
272  return constraints_;
273  }
277  public int getConstraintsCount() {
278  return constraints_.size();
279  }
284  return constraints_.get(index);
285  }
290  int index) {
291  return constraints_.get(index);
292  }
293 
294  public static final int OBJECTIVE_FIELD_NUMBER = 4;
295  private com.google.ortools.sat.CpObjectiveProto objective_;
304  public boolean hasObjective() {
305  return objective_ != null;
306  }
316  return objective_ == null ? com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
317  }
326  return getObjective();
327  }
328 
329  public static final int SEARCH_STRATEGY_FIELD_NUMBER = 5;
330  private java.util.List<com.google.ortools.sat.DecisionStrategyProto> searchStrategy_;
347  return searchStrategy_;
348  }
364  public java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
366  return searchStrategy_;
367  }
383  public int getSearchStrategyCount() {
384  return searchStrategy_.size();
385  }
402  return searchStrategy_.get(index);
403  }
420  int index) {
421  return searchStrategy_.get(index);
422  }
423 
424  public static final int SOLUTION_HINT_FIELD_NUMBER = 6;
425  private com.google.ortools.sat.PartialVariableAssignment solutionHint_;
442  public boolean hasSolutionHint() {
443  return solutionHint_ != null;
444  }
462  return solutionHint_ == null ? com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
463  }
480  return getSolutionHint();
481  }
482 
483  private byte memoizedIsInitialized = -1;
484  @java.lang.Override
485  public final boolean isInitialized() {
486  byte isInitialized = memoizedIsInitialized;
487  if (isInitialized == 1) return true;
488  if (isInitialized == 0) return false;
489 
490  memoizedIsInitialized = 1;
491  return true;
492  }
493 
494  @java.lang.Override
495  public void writeTo(com.google.protobuf.CodedOutputStream output)
496  throws java.io.IOException {
497  if (!getNameBytes().isEmpty()) {
498  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
499  }
500  for (int i = 0; i < variables_.size(); i++) {
501  output.writeMessage(2, variables_.get(i));
502  }
503  for (int i = 0; i < constraints_.size(); i++) {
504  output.writeMessage(3, constraints_.get(i));
505  }
506  if (objective_ != null) {
507  output.writeMessage(4, getObjective());
508  }
509  for (int i = 0; i < searchStrategy_.size(); i++) {
510  output.writeMessage(5, searchStrategy_.get(i));
511  }
512  if (solutionHint_ != null) {
513  output.writeMessage(6, getSolutionHint());
514  }
515  unknownFields.writeTo(output);
516  }
517 
518  @java.lang.Override
519  public int getSerializedSize() {
520  int size = memoizedSize;
521  if (size != -1) return size;
522 
523  size = 0;
524  if (!getNameBytes().isEmpty()) {
525  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
526  }
527  for (int i = 0; i < variables_.size(); i++) {
528  size += com.google.protobuf.CodedOutputStream
529  .computeMessageSize(2, variables_.get(i));
530  }
531  for (int i = 0; i < constraints_.size(); i++) {
532  size += com.google.protobuf.CodedOutputStream
533  .computeMessageSize(3, constraints_.get(i));
534  }
535  if (objective_ != null) {
536  size += com.google.protobuf.CodedOutputStream
537  .computeMessageSize(4, getObjective());
538  }
539  for (int i = 0; i < searchStrategy_.size(); i++) {
540  size += com.google.protobuf.CodedOutputStream
541  .computeMessageSize(5, searchStrategy_.get(i));
542  }
543  if (solutionHint_ != null) {
544  size += com.google.protobuf.CodedOutputStream
545  .computeMessageSize(6, getSolutionHint());
546  }
547  size += unknownFields.getSerializedSize();
548  memoizedSize = size;
549  return size;
550  }
551 
552  @java.lang.Override
553  public boolean equals(final java.lang.Object obj) {
554  if (obj == this) {
555  return true;
556  }
557  if (!(obj instanceof com.google.ortools.sat.CpModelProto)) {
558  return super.equals(obj);
559  }
561 
562  if (!getName()
563  .equals(other.getName())) return false;
564  if (!getVariablesList()
565  .equals(other.getVariablesList())) return false;
566  if (!getConstraintsList()
567  .equals(other.getConstraintsList())) return false;
568  if (hasObjective() != other.hasObjective()) return false;
569  if (hasObjective()) {
570  if (!getObjective()
571  .equals(other.getObjective())) return false;
572  }
573  if (!getSearchStrategyList()
574  .equals(other.getSearchStrategyList())) return false;
575  if (hasSolutionHint() != other.hasSolutionHint()) return false;
576  if (hasSolutionHint()) {
577  if (!getSolutionHint()
578  .equals(other.getSolutionHint())) return false;
579  }
580  if (!unknownFields.equals(other.unknownFields)) return false;
581  return true;
582  }
583 
584  @java.lang.Override
585  public int hashCode() {
586  if (memoizedHashCode != 0) {
587  return memoizedHashCode;
588  }
589  int hash = 41;
590  hash = (19 * hash) + getDescriptor().hashCode();
591  hash = (37 * hash) + NAME_FIELD_NUMBER;
592  hash = (53 * hash) + getName().hashCode();
593  if (getVariablesCount() > 0) {
594  hash = (37 * hash) + VARIABLES_FIELD_NUMBER;
595  hash = (53 * hash) + getVariablesList().hashCode();
596  }
597  if (getConstraintsCount() > 0) {
598  hash = (37 * hash) + CONSTRAINTS_FIELD_NUMBER;
599  hash = (53 * hash) + getConstraintsList().hashCode();
600  }
601  if (hasObjective()) {
602  hash = (37 * hash) + OBJECTIVE_FIELD_NUMBER;
603  hash = (53 * hash) + getObjective().hashCode();
604  }
605  if (getSearchStrategyCount() > 0) {
606  hash = (37 * hash) + SEARCH_STRATEGY_FIELD_NUMBER;
607  hash = (53 * hash) + getSearchStrategyList().hashCode();
608  }
609  if (hasSolutionHint()) {
610  hash = (37 * hash) + SOLUTION_HINT_FIELD_NUMBER;
611  hash = (53 * hash) + getSolutionHint().hashCode();
612  }
613  hash = (29 * hash) + unknownFields.hashCode();
614  memoizedHashCode = hash;
615  return hash;
616  }
617 
619  java.nio.ByteBuffer data)
620  throws com.google.protobuf.InvalidProtocolBufferException {
621  return PARSER.parseFrom(data);
622  }
624  java.nio.ByteBuffer data,
625  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
626  throws com.google.protobuf.InvalidProtocolBufferException {
627  return PARSER.parseFrom(data, extensionRegistry);
628  }
630  com.google.protobuf.ByteString data)
631  throws com.google.protobuf.InvalidProtocolBufferException {
632  return PARSER.parseFrom(data);
633  }
635  com.google.protobuf.ByteString data,
636  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
637  throws com.google.protobuf.InvalidProtocolBufferException {
638  return PARSER.parseFrom(data, extensionRegistry);
639  }
640  public static com.google.ortools.sat.CpModelProto parseFrom(byte[] data)
641  throws com.google.protobuf.InvalidProtocolBufferException {
642  return PARSER.parseFrom(data);
643  }
645  byte[] data,
646  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
647  throws com.google.protobuf.InvalidProtocolBufferException {
648  return PARSER.parseFrom(data, extensionRegistry);
649  }
650  public static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input)
651  throws java.io.IOException {
652  return com.google.protobuf.GeneratedMessageV3
653  .parseWithIOException(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  .parseWithIOException(PARSER, input, extensionRegistry);
661  }
662  public static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input)
663  throws java.io.IOException {
664  return com.google.protobuf.GeneratedMessageV3
665  .parseDelimitedWithIOException(PARSER, input);
666  }
668  java.io.InputStream input,
669  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
670  throws java.io.IOException {
671  return com.google.protobuf.GeneratedMessageV3
672  .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
673  }
675  com.google.protobuf.CodedInputStream input)
676  throws java.io.IOException {
677  return com.google.protobuf.GeneratedMessageV3
678  .parseWithIOException(PARSER, input);
679  }
681  com.google.protobuf.CodedInputStream input,
682  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
683  throws java.io.IOException {
684  return com.google.protobuf.GeneratedMessageV3
685  .parseWithIOException(PARSER, input, extensionRegistry);
686  }
687 
688  @java.lang.Override
689  public Builder newBuilderForType() { return newBuilder(); }
690  public static Builder newBuilder() {
691  return DEFAULT_INSTANCE.toBuilder();
692  }
693  public static Builder newBuilder(com.google.ortools.sat.CpModelProto prototype) {
694  return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
695  }
696  @java.lang.Override
697  public Builder toBuilder() {
698  return this == DEFAULT_INSTANCE
699  ? new Builder() : new Builder().mergeFrom(this);
700  }
701 
702  @java.lang.Override
704  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
705  Builder builder = new Builder(parent);
706  return builder;
707  }
715  public static final class Builder extends
716  com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
717  // @@protoc_insertion_point(builder_implements:operations_research.sat.CpModelProto)
718  com.google.ortools.sat.CpModelProtoOrBuilder {
719  public static final com.google.protobuf.Descriptors.Descriptor
721  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
722  }
723 
724  @java.lang.Override
725  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
727  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_fieldAccessorTable
728  .ensureFieldAccessorsInitialized(
730  }
731 
732  // Construct using com.google.ortools.sat.CpModelProto.newBuilder()
733  private Builder() {
734  maybeForceBuilderInitialization();
735  }
736 
737  private Builder(
738  com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
739  super(parent);
740  maybeForceBuilderInitialization();
741  }
742  private void maybeForceBuilderInitialization() {
743  if (com.google.protobuf.GeneratedMessageV3
744  .alwaysUseFieldBuilders) {
745  getVariablesFieldBuilder();
746  getConstraintsFieldBuilder();
747  getSearchStrategyFieldBuilder();
748  }
749  }
750  @java.lang.Override
751  public Builder clear() {
752  super.clear();
753  name_ = "";
754 
755  if (variablesBuilder_ == null) {
756  variables_ = java.util.Collections.emptyList();
757  bitField0_ = (bitField0_ & ~0x00000001);
758  } else {
759  variablesBuilder_.clear();
760  }
761  if (constraintsBuilder_ == null) {
762  constraints_ = java.util.Collections.emptyList();
763  bitField0_ = (bitField0_ & ~0x00000002);
764  } else {
765  constraintsBuilder_.clear();
766  }
767  if (objectiveBuilder_ == null) {
768  objective_ = null;
769  } else {
770  objective_ = null;
771  objectiveBuilder_ = null;
772  }
773  if (searchStrategyBuilder_ == null) {
774  searchStrategy_ = java.util.Collections.emptyList();
775  bitField0_ = (bitField0_ & ~0x00000004);
776  } else {
777  searchStrategyBuilder_.clear();
778  }
779  if (solutionHintBuilder_ == null) {
780  solutionHint_ = null;
781  } else {
782  solutionHint_ = null;
783  solutionHintBuilder_ = null;
784  }
785  return this;
786  }
787 
788  @java.lang.Override
789  public com.google.protobuf.Descriptors.Descriptor
791  return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
792  }
793 
794  @java.lang.Override
797  }
798 
799  @java.lang.Override
802  if (!result.isInitialized()) {
803  throw newUninitializedMessageException(result);
804  }
805  return result;
806  }
807 
808  @java.lang.Override
811  int from_bitField0_ = bitField0_;
812  result.name_ = name_;
813  if (variablesBuilder_ == null) {
814  if (((bitField0_ & 0x00000001) != 0)) {
815  variables_ = java.util.Collections.unmodifiableList(variables_);
816  bitField0_ = (bitField0_ & ~0x00000001);
817  }
818  result.variables_ = variables_;
819  } else {
820  result.variables_ = variablesBuilder_.build();
821  }
822  if (constraintsBuilder_ == null) {
823  if (((bitField0_ & 0x00000002) != 0)) {
824  constraints_ = java.util.Collections.unmodifiableList(constraints_);
825  bitField0_ = (bitField0_ & ~0x00000002);
826  }
827  result.constraints_ = constraints_;
828  } else {
829  result.constraints_ = constraintsBuilder_.build();
830  }
831  if (objectiveBuilder_ == null) {
832  result.objective_ = objective_;
833  } else {
834  result.objective_ = objectiveBuilder_.build();
835  }
836  if (searchStrategyBuilder_ == null) {
837  if (((bitField0_ & 0x00000004) != 0)) {
838  searchStrategy_ = java.util.Collections.unmodifiableList(searchStrategy_);
839  bitField0_ = (bitField0_ & ~0x00000004);
840  }
841  result.searchStrategy_ = searchStrategy_;
842  } else {
843  result.searchStrategy_ = searchStrategyBuilder_.build();
844  }
845  if (solutionHintBuilder_ == null) {
846  result.solutionHint_ = solutionHint_;
847  } else {
848  result.solutionHint_ = solutionHintBuilder_.build();
849  }
850  onBuilt();
851  return result;
852  }
853 
854  @java.lang.Override
855  public Builder clone() {
856  return super.clone();
857  }
858  @java.lang.Override
860  com.google.protobuf.Descriptors.FieldDescriptor field,
861  java.lang.Object value) {
862  return super.setField(field, value);
863  }
864  @java.lang.Override
866  com.google.protobuf.Descriptors.FieldDescriptor field) {
867  return super.clearField(field);
868  }
869  @java.lang.Override
871  com.google.protobuf.Descriptors.OneofDescriptor oneof) {
872  return super.clearOneof(oneof);
873  }
874  @java.lang.Override
876  com.google.protobuf.Descriptors.FieldDescriptor field,
877  int index, java.lang.Object value) {
878  return super.setRepeatedField(field, index, value);
879  }
880  @java.lang.Override
882  com.google.protobuf.Descriptors.FieldDescriptor field,
883  java.lang.Object value) {
884  return super.addRepeatedField(field, value);
885  }
886  @java.lang.Override
887  public Builder mergeFrom(com.google.protobuf.Message other) {
888  if (other instanceof com.google.ortools.sat.CpModelProto) {
889  return mergeFrom((com.google.ortools.sat.CpModelProto)other);
890  } else {
891  super.mergeFrom(other);
892  return this;
893  }
894  }
895 
897  if (other == com.google.ortools.sat.CpModelProto.getDefaultInstance()) return this;
898  if (!other.getName().isEmpty()) {
899  name_ = other.name_;
900  onChanged();
901  }
902  if (variablesBuilder_ == null) {
903  if (!other.variables_.isEmpty()) {
904  if (variables_.isEmpty()) {
905  variables_ = other.variables_;
906  bitField0_ = (bitField0_ & ~0x00000001);
907  } else {
908  ensureVariablesIsMutable();
909  variables_.addAll(other.variables_);
910  }
911  onChanged();
912  }
913  } else {
914  if (!other.variables_.isEmpty()) {
915  if (variablesBuilder_.isEmpty()) {
916  variablesBuilder_.dispose();
917  variablesBuilder_ = null;
918  variables_ = other.variables_;
919  bitField0_ = (bitField0_ & ~0x00000001);
920  variablesBuilder_ =
921  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
922  getVariablesFieldBuilder() : null;
923  } else {
924  variablesBuilder_.addAllMessages(other.variables_);
925  }
926  }
927  }
928  if (constraintsBuilder_ == null) {
929  if (!other.constraints_.isEmpty()) {
930  if (constraints_.isEmpty()) {
931  constraints_ = other.constraints_;
932  bitField0_ = (bitField0_ & ~0x00000002);
933  } else {
934  ensureConstraintsIsMutable();
935  constraints_.addAll(other.constraints_);
936  }
937  onChanged();
938  }
939  } else {
940  if (!other.constraints_.isEmpty()) {
941  if (constraintsBuilder_.isEmpty()) {
942  constraintsBuilder_.dispose();
943  constraintsBuilder_ = null;
944  constraints_ = other.constraints_;
945  bitField0_ = (bitField0_ & ~0x00000002);
946  constraintsBuilder_ =
947  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
948  getConstraintsFieldBuilder() : null;
949  } else {
950  constraintsBuilder_.addAllMessages(other.constraints_);
951  }
952  }
953  }
954  if (other.hasObjective()) {
955  mergeObjective(other.getObjective());
956  }
957  if (searchStrategyBuilder_ == null) {
958  if (!other.searchStrategy_.isEmpty()) {
959  if (searchStrategy_.isEmpty()) {
960  searchStrategy_ = other.searchStrategy_;
961  bitField0_ = (bitField0_ & ~0x00000004);
962  } else {
963  ensureSearchStrategyIsMutable();
964  searchStrategy_.addAll(other.searchStrategy_);
965  }
966  onChanged();
967  }
968  } else {
969  if (!other.searchStrategy_.isEmpty()) {
970  if (searchStrategyBuilder_.isEmpty()) {
971  searchStrategyBuilder_.dispose();
972  searchStrategyBuilder_ = null;
973  searchStrategy_ = other.searchStrategy_;
974  bitField0_ = (bitField0_ & ~0x00000004);
975  searchStrategyBuilder_ =
976  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
977  getSearchStrategyFieldBuilder() : null;
978  } else {
979  searchStrategyBuilder_.addAllMessages(other.searchStrategy_);
980  }
981  }
982  }
983  if (other.hasSolutionHint()) {
984  mergeSolutionHint(other.getSolutionHint());
985  }
986  this.mergeUnknownFields(other.unknownFields);
987  onChanged();
988  return this;
989  }
990 
991  @java.lang.Override
992  public final boolean isInitialized() {
993  return true;
994  }
995 
996  @java.lang.Override
998  com.google.protobuf.CodedInputStream input,
999  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1000  throws java.io.IOException {
1001  com.google.ortools.sat.CpModelProto parsedMessage = null;
1002  try {
1003  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
1004  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1005  parsedMessage = (com.google.ortools.sat.CpModelProto) e.getUnfinishedMessage();
1006  throw e.unwrapIOException();
1007  } finally {
1008  if (parsedMessage != null) {
1009  mergeFrom(parsedMessage);
1010  }
1011  }
1012  return this;
1013  }
1014  private int bitField0_;
1015 
1016  private java.lang.Object name_ = "";
1025  public java.lang.String getName() {
1026  java.lang.Object ref = name_;
1027  if (!(ref instanceof java.lang.String)) {
1028  com.google.protobuf.ByteString bs =
1029  (com.google.protobuf.ByteString) ref;
1030  java.lang.String s = bs.toStringUtf8();
1031  name_ = s;
1032  return s;
1033  } else {
1034  return (java.lang.String) ref;
1035  }
1036  }
1045  public com.google.protobuf.ByteString
1047  java.lang.Object ref = name_;
1048  if (ref instanceof String) {
1049  com.google.protobuf.ByteString b =
1050  com.google.protobuf.ByteString.copyFromUtf8(
1051  (java.lang.String) ref);
1052  name_ = b;
1053  return b;
1054  } else {
1055  return (com.google.protobuf.ByteString) ref;
1056  }
1057  }
1068  java.lang.String value) {
1069  if (value == null) {
1070  throw new NullPointerException();
1071  }
1072 
1073  name_ = value;
1074  onChanged();
1075  return this;
1076  }
1085  public Builder clearName() {
1086 
1087  name_ = getDefaultInstance().getName();
1088  onChanged();
1089  return this;
1090  }
1101  com.google.protobuf.ByteString value) {
1102  if (value == null) {
1103  throw new NullPointerException();
1104  }
1105  checkByteStringIsUtf8(value);
1106 
1107  name_ = value;
1108  onChanged();
1109  return this;
1110  }
1111 
1112  private java.util.List<com.google.ortools.sat.IntegerVariableProto> variables_ =
1113  java.util.Collections.emptyList();
1114  private void ensureVariablesIsMutable() {
1115  if (!((bitField0_ & 0x00000001) != 0)) {
1116  variables_ = new java.util.ArrayList<com.google.ortools.sat.IntegerVariableProto>(variables_);
1117  bitField0_ |= 0x00000001;
1118  }
1119  }
1120 
1121  private com.google.protobuf.RepeatedFieldBuilderV3<
1123 
1132  if (variablesBuilder_ == null) {
1133  return java.util.Collections.unmodifiableList(variables_);
1134  } else {
1135  return variablesBuilder_.getMessageList();
1136  }
1137  }
1145  public int getVariablesCount() {
1146  if (variablesBuilder_ == null) {
1147  return variables_.size();
1148  } else {
1149  return variablesBuilder_.getCount();
1150  }
1151  }
1160  if (variablesBuilder_ == null) {
1161  return variables_.get(index);
1162  } else {
1163  return variablesBuilder_.getMessage(index);
1164  }
1165  }
1174  int index, com.google.ortools.sat.IntegerVariableProto value) {
1175  if (variablesBuilder_ == null) {
1176  if (value == null) {
1177  throw new NullPointerException();
1178  }
1179  ensureVariablesIsMutable();
1180  variables_.set(index, value);
1181  onChanged();
1182  } else {
1183  variablesBuilder_.setMessage(index, value);
1184  }
1185  return this;
1186  }
1195  int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1196  if (variablesBuilder_ == null) {
1197  ensureVariablesIsMutable();
1198  variables_.set(index, builderForValue.build());
1199  onChanged();
1200  } else {
1201  variablesBuilder_.setMessage(index, builderForValue.build());
1202  }
1203  return this;
1204  }
1213  if (variablesBuilder_ == null) {
1214  if (value == null) {
1215  throw new NullPointerException();
1216  }
1217  ensureVariablesIsMutable();
1218  variables_.add(value);
1219  onChanged();
1220  } else {
1221  variablesBuilder_.addMessage(value);
1222  }
1223  return this;
1224  }
1233  int index, com.google.ortools.sat.IntegerVariableProto value) {
1234  if (variablesBuilder_ == null) {
1235  if (value == null) {
1236  throw new NullPointerException();
1237  }
1238  ensureVariablesIsMutable();
1239  variables_.add(index, value);
1240  onChanged();
1241  } else {
1242  variablesBuilder_.addMessage(index, value);
1243  }
1244  return this;
1245  }
1254  com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1255  if (variablesBuilder_ == null) {
1256  ensureVariablesIsMutable();
1257  variables_.add(builderForValue.build());
1258  onChanged();
1259  } else {
1260  variablesBuilder_.addMessage(builderForValue.build());
1261  }
1262  return this;
1263  }
1272  int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
1273  if (variablesBuilder_ == null) {
1274  ensureVariablesIsMutable();
1275  variables_.add(index, builderForValue.build());
1276  onChanged();
1277  } else {
1278  variablesBuilder_.addMessage(index, builderForValue.build());
1279  }
1280  return this;
1281  }
1290  java.lang.Iterable<? extends com.google.ortools.sat.IntegerVariableProto> values) {
1291  if (variablesBuilder_ == null) {
1292  ensureVariablesIsMutable();
1293  com.google.protobuf.AbstractMessageLite.Builder.addAll(
1294  values, variables_);
1295  onChanged();
1296  } else {
1297  variablesBuilder_.addAllMessages(values);
1298  }
1299  return this;
1300  }
1309  if (variablesBuilder_ == null) {
1310  variables_ = java.util.Collections.emptyList();
1311  bitField0_ = (bitField0_ & ~0x00000001);
1312  onChanged();
1313  } else {
1314  variablesBuilder_.clear();
1315  }
1316  return this;
1317  }
1325  public Builder removeVariables(int index) {
1326  if (variablesBuilder_ == null) {
1327  ensureVariablesIsMutable();
1328  variables_.remove(index);
1329  onChanged();
1330  } else {
1331  variablesBuilder_.remove(index);
1332  }
1333  return this;
1334  }
1343  int index) {
1344  return getVariablesFieldBuilder().getBuilder(index);
1345  }
1354  int index) {
1355  if (variablesBuilder_ == null) {
1356  return variables_.get(index); } else {
1357  return variablesBuilder_.getMessageOrBuilder(index);
1358  }
1359  }
1367  public java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder>
1369  if (variablesBuilder_ != null) {
1370  return variablesBuilder_.getMessageOrBuilderList();
1371  } else {
1372  return java.util.Collections.unmodifiableList(variables_);
1373  }
1374  }
1383  return getVariablesFieldBuilder().addBuilder(
1385  }
1394  int index) {
1395  return getVariablesFieldBuilder().addBuilder(
1397  }
1405  public java.util.List<com.google.ortools.sat.IntegerVariableProto.Builder>
1407  return getVariablesFieldBuilder().getBuilderList();
1408  }
1409  private com.google.protobuf.RepeatedFieldBuilderV3<
1411  getVariablesFieldBuilder() {
1412  if (variablesBuilder_ == null) {
1413  variablesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1415  variables_,
1416  ((bitField0_ & 0x00000001) != 0),
1417  getParentForChildren(),
1418  isClean());
1419  variables_ = null;
1420  }
1421  return variablesBuilder_;
1422  }
1423 
1424  private java.util.List<com.google.ortools.sat.ConstraintProto> constraints_ =
1425  java.util.Collections.emptyList();
1426  private void ensureConstraintsIsMutable() {
1427  if (!((bitField0_ & 0x00000002) != 0)) {
1428  constraints_ = new java.util.ArrayList<com.google.ortools.sat.ConstraintProto>(constraints_);
1429  bitField0_ |= 0x00000002;
1430  }
1431  }
1432 
1433  private com.google.protobuf.RepeatedFieldBuilderV3<
1435 
1440  if (constraintsBuilder_ == null) {
1441  return java.util.Collections.unmodifiableList(constraints_);
1442  } else {
1443  return constraintsBuilder_.getMessageList();
1444  }
1445  }
1449  public int getConstraintsCount() {
1450  if (constraintsBuilder_ == null) {
1451  return constraints_.size();
1452  } else {
1453  return constraintsBuilder_.getCount();
1454  }
1455  }
1460  if (constraintsBuilder_ == null) {
1461  return constraints_.get(index);
1462  } else {
1463  return constraintsBuilder_.getMessage(index);
1464  }
1465  }
1470  int index, com.google.ortools.sat.ConstraintProto value) {
1471  if (constraintsBuilder_ == null) {
1472  if (value == null) {
1473  throw new NullPointerException();
1474  }
1475  ensureConstraintsIsMutable();
1476  constraints_.set(index, value);
1477  onChanged();
1478  } else {
1479  constraintsBuilder_.setMessage(index, value);
1480  }
1481  return this;
1482  }
1487  int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1488  if (constraintsBuilder_ == null) {
1489  ensureConstraintsIsMutable();
1490  constraints_.set(index, builderForValue.build());
1491  onChanged();
1492  } else {
1493  constraintsBuilder_.setMessage(index, builderForValue.build());
1494  }
1495  return this;
1496  }
1501  if (constraintsBuilder_ == null) {
1502  if (value == null) {
1503  throw new NullPointerException();
1504  }
1505  ensureConstraintsIsMutable();
1506  constraints_.add(value);
1507  onChanged();
1508  } else {
1509  constraintsBuilder_.addMessage(value);
1510  }
1511  return this;
1512  }
1517  int index, com.google.ortools.sat.ConstraintProto value) {
1518  if (constraintsBuilder_ == null) {
1519  if (value == null) {
1520  throw new NullPointerException();
1521  }
1522  ensureConstraintsIsMutable();
1523  constraints_.add(index, value);
1524  onChanged();
1525  } else {
1526  constraintsBuilder_.addMessage(index, value);
1527  }
1528  return this;
1529  }
1534  com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1535  if (constraintsBuilder_ == null) {
1536  ensureConstraintsIsMutable();
1537  constraints_.add(builderForValue.build());
1538  onChanged();
1539  } else {
1540  constraintsBuilder_.addMessage(builderForValue.build());
1541  }
1542  return this;
1543  }
1548  int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
1549  if (constraintsBuilder_ == null) {
1550  ensureConstraintsIsMutable();
1551  constraints_.add(index, builderForValue.build());
1552  onChanged();
1553  } else {
1554  constraintsBuilder_.addMessage(index, builderForValue.build());
1555  }
1556  return this;
1557  }
1562  java.lang.Iterable<? extends com.google.ortools.sat.ConstraintProto> values) {
1563  if (constraintsBuilder_ == null) {
1564  ensureConstraintsIsMutable();
1565  com.google.protobuf.AbstractMessageLite.Builder.addAll(
1566  values, constraints_);
1567  onChanged();
1568  } else {
1569  constraintsBuilder_.addAllMessages(values);
1570  }
1571  return this;
1572  }
1577  if (constraintsBuilder_ == null) {
1578  constraints_ = java.util.Collections.emptyList();
1579  bitField0_ = (bitField0_ & ~0x00000002);
1580  onChanged();
1581  } else {
1582  constraintsBuilder_.clear();
1583  }
1584  return this;
1585  }
1589  public Builder removeConstraints(int index) {
1590  if (constraintsBuilder_ == null) {
1591  ensureConstraintsIsMutable();
1592  constraints_.remove(index);
1593  onChanged();
1594  } else {
1595  constraintsBuilder_.remove(index);
1596  }
1597  return this;
1598  }
1603  int index) {
1604  return getConstraintsFieldBuilder().getBuilder(index);
1605  }
1610  int index) {
1611  if (constraintsBuilder_ == null) {
1612  return constraints_.get(index); } else {
1613  return constraintsBuilder_.getMessageOrBuilder(index);
1614  }
1615  }
1619  public java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder>
1621  if (constraintsBuilder_ != null) {
1622  return constraintsBuilder_.getMessageOrBuilderList();
1623  } else {
1624  return java.util.Collections.unmodifiableList(constraints_);
1625  }
1626  }
1631  return getConstraintsFieldBuilder().addBuilder(
1633  }
1638  int index) {
1639  return getConstraintsFieldBuilder().addBuilder(
1641  }
1645  public java.util.List<com.google.ortools.sat.ConstraintProto.Builder>
1647  return getConstraintsFieldBuilder().getBuilderList();
1648  }
1649  private com.google.protobuf.RepeatedFieldBuilderV3<
1651  getConstraintsFieldBuilder() {
1652  if (constraintsBuilder_ == null) {
1653  constraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1655  constraints_,
1656  ((bitField0_ & 0x00000002) != 0),
1657  getParentForChildren(),
1658  isClean());
1659  constraints_ = null;
1660  }
1661  return constraintsBuilder_;
1662  }
1663 
1664  private com.google.ortools.sat.CpObjectiveProto objective_;
1665  private com.google.protobuf.SingleFieldBuilderV3<
1675  public boolean hasObjective() {
1676  return objectiveBuilder_ != null || objective_ != null;
1677  }
1687  if (objectiveBuilder_ == null) {
1688  return objective_ == null ? com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
1689  } else {
1690  return objectiveBuilder_.getMessage();
1691  }
1692  }
1701  if (objectiveBuilder_ == null) {
1702  if (value == null) {
1703  throw new NullPointerException();
1704  }
1705  objective_ = value;
1706  onChanged();
1707  } else {
1708  objectiveBuilder_.setMessage(value);
1709  }
1710 
1711  return this;
1712  }
1721  com.google.ortools.sat.CpObjectiveProto.Builder builderForValue) {
1722  if (objectiveBuilder_ == null) {
1723  objective_ = builderForValue.build();
1724  onChanged();
1725  } else {
1726  objectiveBuilder_.setMessage(builderForValue.build());
1727  }
1728 
1729  return this;
1730  }
1739  if (objectiveBuilder_ == null) {
1740  if (objective_ != null) {
1741  objective_ =
1743  } else {
1744  objective_ = value;
1745  }
1746  onChanged();
1747  } else {
1748  objectiveBuilder_.mergeFrom(value);
1749  }
1750 
1751  return this;
1752  }
1761  if (objectiveBuilder_ == null) {
1762  objective_ = null;
1763  onChanged();
1764  } else {
1765  objective_ = null;
1766  objectiveBuilder_ = null;
1767  }
1768 
1769  return this;
1770  }
1779 
1780  onChanged();
1781  return getObjectiveFieldBuilder().getBuilder();
1782  }
1791  if (objectiveBuilder_ != null) {
1792  return objectiveBuilder_.getMessageOrBuilder();
1793  } else {
1794  return objective_ == null ?
1796  }
1797  }
1805  private com.google.protobuf.SingleFieldBuilderV3<
1807  getObjectiveFieldBuilder() {
1808  if (objectiveBuilder_ == null) {
1809  objectiveBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
1811  getObjective(),
1812  getParentForChildren(),
1813  isClean());
1814  objective_ = null;
1815  }
1816  return objectiveBuilder_;
1817  }
1818 
1819  private java.util.List<com.google.ortools.sat.DecisionStrategyProto> searchStrategy_ =
1820  java.util.Collections.emptyList();
1821  private void ensureSearchStrategyIsMutable() {
1822  if (!((bitField0_ & 0x00000004) != 0)) {
1823  searchStrategy_ = new java.util.ArrayList<com.google.ortools.sat.DecisionStrategyProto>(searchStrategy_);
1824  bitField0_ |= 0x00000004;
1825  }
1826  }
1827 
1828  private com.google.protobuf.RepeatedFieldBuilderV3<
1830 
1847  if (searchStrategyBuilder_ == null) {
1848  return java.util.Collections.unmodifiableList(searchStrategy_);
1849  } else {
1850  return searchStrategyBuilder_.getMessageList();
1851  }
1852  }
1868  public int getSearchStrategyCount() {
1869  if (searchStrategyBuilder_ == null) {
1870  return searchStrategy_.size();
1871  } else {
1872  return searchStrategyBuilder_.getCount();
1873  }
1874  }
1891  if (searchStrategyBuilder_ == null) {
1892  return searchStrategy_.get(index);
1893  } else {
1894  return searchStrategyBuilder_.getMessage(index);
1895  }
1896  }
1913  int index, com.google.ortools.sat.DecisionStrategyProto value) {
1914  if (searchStrategyBuilder_ == null) {
1915  if (value == null) {
1916  throw new NullPointerException();
1917  }
1918  ensureSearchStrategyIsMutable();
1919  searchStrategy_.set(index, value);
1920  onChanged();
1921  } else {
1922  searchStrategyBuilder_.setMessage(index, value);
1923  }
1924  return this;
1925  }
1942  int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
1943  if (searchStrategyBuilder_ == null) {
1944  ensureSearchStrategyIsMutable();
1945  searchStrategy_.set(index, builderForValue.build());
1946  onChanged();
1947  } else {
1948  searchStrategyBuilder_.setMessage(index, builderForValue.build());
1949  }
1950  return this;
1951  }
1968  if (searchStrategyBuilder_ == null) {
1969  if (value == null) {
1970  throw new NullPointerException();
1971  }
1972  ensureSearchStrategyIsMutable();
1973  searchStrategy_.add(value);
1974  onChanged();
1975  } else {
1976  searchStrategyBuilder_.addMessage(value);
1977  }
1978  return this;
1979  }
1996  int index, com.google.ortools.sat.DecisionStrategyProto value) {
1997  if (searchStrategyBuilder_ == null) {
1998  if (value == null) {
1999  throw new NullPointerException();
2000  }
2001  ensureSearchStrategyIsMutable();
2002  searchStrategy_.add(index, value);
2003  onChanged();
2004  } else {
2005  searchStrategyBuilder_.addMessage(index, value);
2006  }
2007  return this;
2008  }
2025  com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
2026  if (searchStrategyBuilder_ == null) {
2027  ensureSearchStrategyIsMutable();
2028  searchStrategy_.add(builderForValue.build());
2029  onChanged();
2030  } else {
2031  searchStrategyBuilder_.addMessage(builderForValue.build());
2032  }
2033  return this;
2034  }
2051  int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
2052  if (searchStrategyBuilder_ == null) {
2053  ensureSearchStrategyIsMutable();
2054  searchStrategy_.add(index, builderForValue.build());
2055  onChanged();
2056  } else {
2057  searchStrategyBuilder_.addMessage(index, builderForValue.build());
2058  }
2059  return this;
2060  }
2077  java.lang.Iterable<? extends com.google.ortools.sat.DecisionStrategyProto> values) {
2078  if (searchStrategyBuilder_ == null) {
2079  ensureSearchStrategyIsMutable();
2080  com.google.protobuf.AbstractMessageLite.Builder.addAll(
2081  values, searchStrategy_);
2082  onChanged();
2083  } else {
2084  searchStrategyBuilder_.addAllMessages(values);
2085  }
2086  return this;
2087  }
2104  if (searchStrategyBuilder_ == null) {
2105  searchStrategy_ = java.util.Collections.emptyList();
2106  bitField0_ = (bitField0_ & ~0x00000004);
2107  onChanged();
2108  } else {
2109  searchStrategyBuilder_.clear();
2110  }
2111  return this;
2112  }
2128  public Builder removeSearchStrategy(int index) {
2129  if (searchStrategyBuilder_ == null) {
2130  ensureSearchStrategyIsMutable();
2131  searchStrategy_.remove(index);
2132  onChanged();
2133  } else {
2134  searchStrategyBuilder_.remove(index);
2135  }
2136  return this;
2137  }
2154  int index) {
2155  return getSearchStrategyFieldBuilder().getBuilder(index);
2156  }
2173  int index) {
2174  if (searchStrategyBuilder_ == null) {
2175  return searchStrategy_.get(index); } else {
2176  return searchStrategyBuilder_.getMessageOrBuilder(index);
2177  }
2178  }
2194  public java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
2196  if (searchStrategyBuilder_ != null) {
2197  return searchStrategyBuilder_.getMessageOrBuilderList();
2198  } else {
2199  return java.util.Collections.unmodifiableList(searchStrategy_);
2200  }
2201  }
2218  return getSearchStrategyFieldBuilder().addBuilder(
2220  }
2237  int index) {
2238  return getSearchStrategyFieldBuilder().addBuilder(
2240  }
2256  public java.util.List<com.google.ortools.sat.DecisionStrategyProto.Builder>
2258  return getSearchStrategyFieldBuilder().getBuilderList();
2259  }
2260  private com.google.protobuf.RepeatedFieldBuilderV3<
2262  getSearchStrategyFieldBuilder() {
2263  if (searchStrategyBuilder_ == null) {
2264  searchStrategyBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
2266  searchStrategy_,
2267  ((bitField0_ & 0x00000004) != 0),
2268  getParentForChildren(),
2269  isClean());
2270  searchStrategy_ = null;
2271  }
2272  return searchStrategyBuilder_;
2273  }
2274 
2275  private com.google.ortools.sat.PartialVariableAssignment solutionHint_;
2276  private com.google.protobuf.SingleFieldBuilderV3<
2294  public boolean hasSolutionHint() {
2295  return solutionHintBuilder_ != null || solutionHint_ != null;
2296  }
2314  if (solutionHintBuilder_ == null) {
2315  return solutionHint_ == null ? com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
2316  } else {
2317  return solutionHintBuilder_.getMessage();
2318  }
2319  }
2336  if (solutionHintBuilder_ == null) {
2337  if (value == null) {
2338  throw new NullPointerException();
2339  }
2340  solutionHint_ = value;
2341  onChanged();
2342  } else {
2343  solutionHintBuilder_.setMessage(value);
2344  }
2345 
2346  return this;
2347  }
2365  if (solutionHintBuilder_ == null) {
2366  solutionHint_ = builderForValue.build();
2367  onChanged();
2368  } else {
2369  solutionHintBuilder_.setMessage(builderForValue.build());
2370  }
2371 
2372  return this;
2373  }
2390  if (solutionHintBuilder_ == null) {
2391  if (solutionHint_ != null) {
2392  solutionHint_ =
2394  } else {
2395  solutionHint_ = value;
2396  }
2397  onChanged();
2398  } else {
2399  solutionHintBuilder_.mergeFrom(value);
2400  }
2401 
2402  return this;
2403  }
2420  if (solutionHintBuilder_ == null) {
2421  solutionHint_ = null;
2422  onChanged();
2423  } else {
2424  solutionHint_ = null;
2425  solutionHintBuilder_ = null;
2426  }
2427 
2428  return this;
2429  }
2446 
2447  onChanged();
2448  return getSolutionHintFieldBuilder().getBuilder();
2449  }
2466  if (solutionHintBuilder_ != null) {
2467  return solutionHintBuilder_.getMessageOrBuilder();
2468  } else {
2469  return solutionHint_ == null ?
2471  }
2472  }
2488  private com.google.protobuf.SingleFieldBuilderV3<
2490  getSolutionHintFieldBuilder() {
2491  if (solutionHintBuilder_ == null) {
2492  solutionHintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
2494  getSolutionHint(),
2495  getParentForChildren(),
2496  isClean());
2497  solutionHint_ = null;
2498  }
2499  return solutionHintBuilder_;
2500  }
2501  @java.lang.Override
2503  final com.google.protobuf.UnknownFieldSet unknownFields) {
2504  return super.setUnknownFields(unknownFields);
2505  }
2506 
2507  @java.lang.Override
2509  final com.google.protobuf.UnknownFieldSet unknownFields) {
2510  return super.mergeUnknownFields(unknownFields);
2511  }
2512 
2513 
2514  // @@protoc_insertion_point(builder_scope:operations_research.sat.CpModelProto)
2515  }
2516 
2517  // @@protoc_insertion_point(class_scope:operations_research.sat.CpModelProto)
2518  private static final com.google.ortools.sat.CpModelProto DEFAULT_INSTANCE;
2519  static {
2520  DEFAULT_INSTANCE = new com.google.ortools.sat.CpModelProto();
2521  }
2522 
2524  return DEFAULT_INSTANCE;
2525  }
2526 
2527  private static final com.google.protobuf.Parser<CpModelProto>
2528  PARSER = new com.google.protobuf.AbstractParser<CpModelProto>() {
2529  @java.lang.Override
2530  public CpModelProto parsePartialFrom(
2531  com.google.protobuf.CodedInputStream input,
2532  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2533  throws com.google.protobuf.InvalidProtocolBufferException {
2534  return new CpModelProto(input, extensionRegistry);
2535  }
2536  };
2537 
2538  public static com.google.protobuf.Parser<CpModelProto> parser() {
2539  return PARSER;
2540  }
2541 
2542  @java.lang.Override
2543  public com.google.protobuf.Parser<CpModelProto> getParserForType() {
2544  return PARSER;
2545  }
2546 
2547  @java.lang.Override
2549  return DEFAULT_INSTANCE;
2550  }
2551 
2552 }
2553 
Builder clearConstraints()
repeated .operations_research.sat.ConstraintProto constraints = 3;
boolean hasSolutionHint()
static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input)
Builder setObjective(com.google.ortools.sat.CpObjectiveProto value)
static Builder newBuilder()
.lang.Override boolean equals(final java.lang.Object obj)
static com.google.protobuf.Parser< ConstraintProto > parser()
Builder addConstraints(int index, com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder setSolutionHint(com.google.ortools.sat.PartialVariableAssignment value)
.lang.Override final com.google.protobuf.UnknownFieldSet getUnknownFields()
com.google.ortools.sat.CpObjectiveProto getObjective()
com.google.ortools.sat.CpObjectiveProto.Builder getObjectiveBuilder()
com.google.ortools.sat.IntegerVariableProto.Builder getVariablesBuilder(int index)
Builder addVariables(com.google.ortools.sat.IntegerVariableProto value)
com.google.ortools.sat.IntegerVariableProto.Builder addVariablesBuilder(int index)
.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
static final int VARIABLES_FIELD_NUMBER
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
Builder setSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto value)
.lang.Override Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
Builder setObjective(com.google.ortools.sat.CpObjectiveProto.Builder builderForValue)
com.google.ortools.sat.ConstraintProto.Builder getConstraintsBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.protobuf.Parser< CpObjectiveProto > parser()
.lang.Override final boolean isInitialized()
Builder clearObjective()
static com.google.protobuf.Parser< IntegerVariableProto > parser()
int getConstraintsCount()
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.CpModelProto getDefaultInstance()
Builder mergeObjective(com.google.ortools.sat.CpObjectiveProto value)
Builder addConstraints(com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override com.google.ortools.sat.CpObjectiveProto buildPartial()
.lang.Override com.google.ortools.sat.CpModelProto getDefaultInstanceForType()
.lang.Override Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CpObjectiveProto getDefaultInstance()
Builder setConstraints(int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.CpModelProto parseFrom(byte[] data)
com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(int index)
.lang.Override int hashCode()
Builder mergeFrom(com.google.ortools.sat.CpModelProto other)
.lang.Override int hashCode()
Builder addVariables(int index, com.google.ortools.sat.IntegerVariableProto value)
static final int NAME_FIELD_NUMBER
com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(int index)
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override com.google.protobuf.Parser< CpModelProto > getParserForType()
com.google.ortools.sat.ConstraintProto.Builder addConstraintsBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override com.google.ortools.sat.PartialVariableAssignment buildPartial()
Builder clearName()
com.google.ortools.sat.IntegerVariableProto getVariables(int index)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
java.util.List< com.google.ortools.sat.ConstraintProto > getConstraintsList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(int index)
.lang.Override Builder toBuilder()
com.google.protobuf.ByteString getNameBytes()
com.google.ortools.sat.DecisionStrategyProto.Builder getSearchStrategyBuilder(int index)
int getSearchStrategyCount()
static com.google.ortools.sat.CpModelProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
.lang.Override Builder clear()
.lang.Override final boolean isInitialized()
.lang.Override int getSerializedSize()
com.google.ortools.sat.ConstraintProto.Builder addConstraintsBuilder()
repeated .operations_research.sat.ConstraintProto constraints = 3;
java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder > getSearchStrategyOrBuilderList()
boolean hasObjective()
Builder removeVariables(int index)
Builder mergeSolutionHint(com.google.ortools.sat.PartialVariableAssignment value)
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
.lang.Override Builder mergeFrom(com.google.protobuf.Message other)
java.util.List< com.google.ortools.sat.ConstraintProto.Builder > getConstraintsBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
static Builder newBuilder(com.google.ortools.sat.CpModelProto prototype)
static com.google.protobuf.Parser< CpModelProto > parser()
static com.google.ortools.sat.PartialVariableAssignment getDefaultInstance()
com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
int getVariablesCount()
Builder setVariables(int index, com.google.ortools.sat.IntegerVariableProto value)
com.google.protobuf.ByteString getNameBytes()
java.util.List< com.google.ortools.sat.IntegerVariableProto > getVariablesList()
.lang.Override Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
static com.google.ortools.sat.DecisionStrategyProto getDefaultInstance()
Builder setConstraints(int index, com.google.ortools.sat.ConstraintProto value)
repeated .operations_research.sat.ConstraintProto constraints = 3;
java.util.List< com.google.ortools.sat.IntegerVariableProto.Builder > getVariablesBuilderList()
com.google.ortools.sat.PartialVariableAssignment.Builder getSolutionHintBuilder()
.lang.Override Builder toBuilder()
java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder > getSearchStrategyOrBuilderList()
java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder > getConstraintsOrBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addVariables(int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
.lang.Override Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder > getVariablesOrBuilderList()
.lang.Override com.google.ortools.sat.CpModelProto build()
.lang.Override final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
com.google.ortools.sat.DecisionStrategyProto.Builder addSearchStrategyBuilder(int index)
static com.google.protobuf.Parser< DecisionStrategyProto > parser()
java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder > getConstraintsOrBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
.lang.Override Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder addConstraints(int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder clearVariables()
static com.google.protobuf.Parser< PartialVariableAssignment > parser()
com.google.ortools.sat.DecisionStrategyProto.Builder addSearchStrategyBuilder()
.lang.Override Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
.lang.Override java.lang.Object newInstance(UnusedPrivateParameter unused)
Builder addSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
int getVariablesCount()
boolean hasSolutionHint()
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
.lang.Override boolean equals(final java.lang.Object obj)
int getConstraintsCount()
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.CpModelProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder addSearchStrategy(com.google.ortools.sat.DecisionStrategyProto value)
.lang.Override com.google.ortools.sat.CpModelProto buildPartial()
Builder clearSolutionHint()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.sat.DecisionStrategyProto getSearchStrategy(int index)
java.lang.String getName()
boolean hasObjective()
.lang.Override boolean equals(final java.lang.Object obj)
Builder removeConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static final int SOLUTION_HINT_FIELD_NUMBER
com.google.ortools.sat.ConstraintProto getConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
static com.google.ortools.sat.ConstraintProto getDefaultInstance()
.lang.Override com.google.ortools.sat.CpModelProto getDefaultInstanceForType()
.lang.Override final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder()
java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder > getVariablesOrBuilderList()
.lang.Override Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
Builder setVariables(int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
static final int CONSTRAINTS_FIELD_NUMBER
Builder setName(java.lang.String value)
static com.google.ortools.sat.CpModelProto parseFrom(java.nio.ByteBuffer data)
Builder addSearchStrategy(com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addVariables(com.google.ortools.sat.IntegerVariableProto.Builder builderForValue)
.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Builder addAllConstraints(java.lang.Iterable<? extends com.google.ortools.sat.ConstraintProto > values)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder removeSearchStrategy(int index)
Builder addAllSearchStrategy(java.lang.Iterable<? extends com.google.ortools.sat.DecisionStrategyProto > values)
.lang.Override int hashCode()
java.util.List< com.google.ortools.sat.DecisionStrategyProto > getSearchStrategyList()
com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(int index)
int getSearchStrategyCount()
Builder setNameBytes(com.google.protobuf.ByteString value)
static Builder newBuilder()
com.google.ortools.sat.IntegerVariableProto getVariables(int index)
static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input)
static final int OBJECTIVE_FIELD_NUMBER
java.util.List< com.google.ortools.sat.ConstraintProto > getConstraintsList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder()
.lang.Override Builder clone()
.lang.Override Builder toBuilder()
java.util.List< com.google.ortools.sat.IntegerVariableProto > getVariablesList()
com.google.ortools.sat.IntegerVariableProto.Builder addVariablesBuilder()
static com.google.ortools.sat.IntegerVariableProto getDefaultInstance()
java.util.List< com.google.ortools.sat.DecisionStrategyProto.Builder > getSearchStrategyBuilderList()
com.google.ortools.sat.PartialVariableAssignment getSolutionHint()
static final int SEARCH_STRATEGY_FIELD_NUMBER
.lang.Override Builder newBuilderForType()
com.google.ortools.sat.PartialVariableAssignment getSolutionHint()
static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static Builder newBuilder()
.lang.Override void writeTo(com.google.protobuf.CodedOutputStream output)
Builder setSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue)
java.lang.String getName()
com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder()
Builder addConstraints(com.google.ortools.sat.ConstraintProto.Builder builderForValue)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addSearchStrategy(int index, com.google.ortools.sat.DecisionStrategyProto value)
Builder setSolutionHint(com.google.ortools.sat.PartialVariableAssignment.Builder builderForValue)
Builder clearSearchStrategy()
static com.google.ortools.sat.CpModelProto parseFrom(com.google.protobuf.CodedInputStream input)
com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder()
com.google.ortools.sat.DecisionStrategyProto getSearchStrategy(int index)
java.util.List< com.google.ortools.sat.DecisionStrategyProto > getSearchStrategyList()
com.google.ortools.sat.ConstraintProto getConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
Builder addAllVariables(java.lang.Iterable<? extends com.google.ortools.sat.IntegerVariableProto > values)
com.google.ortools.sat.CpObjectiveProto getObjective()