6package com.google.ortools.sat;
15public final class AllDifferentConstraintProto
extends
16 com.google.protobuf.GeneratedMessage implements
19private static final long serialVersionUID = 0L;
21 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
22 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
27 AllDifferentConstraintProto.class.getName());
30 private AllDifferentConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
33 private AllDifferentConstraintProto() {
34 exprs_ = java.util.Collections.emptyList();
37 public static final com.google.protobuf.Descriptors.Descriptor
39 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_AllDifferentConstraintProto_descriptor;
43 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
45 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_AllDifferentConstraintProto_fieldAccessorTable
46 .ensureFieldAccessorsInitialized(
47 com.google.ortools.sat.AllDifferentConstraintProto.class, com.google.ortools.sat.AllDifferentConstraintProto.Builder.class);
51 @SuppressWarnings(
"serial")
64 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
80 return exprs_.get(index);
88 return exprs_.get(index);
91 private byte memoizedIsInitialized = -1;
98 memoizedIsInitialized = 1;
103 public void writeTo(com.google.protobuf.CodedOutputStream output)
104 throws java.io.IOException {
105 for (
int i = 0; i < exprs_.size(); i++) {
106 output.writeMessage(1, exprs_.get(i));
108 getUnknownFields().writeTo(output);
113 int size = memoizedSize;
114 if (size != -1)
return size;
117 for (
int i = 0; i < exprs_.size(); i++) {
118 size += com.google.protobuf.CodedOutputStream
119 .computeMessageSize(1, exprs_.get(i));
121 size += getUnknownFields().getSerializedSize();
127 public boolean equals(
final java.lang.Object obj) {
131 if (!(obj instanceof com.google.ortools.sat.AllDifferentConstraintProto)) {
132 return super.equals(obj);
138 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
144 if (memoizedHashCode != 0) {
145 return memoizedHashCode;
153 hash = (29 * hash) + getUnknownFields().hashCode();
154 memoizedHashCode = hash;
159 java.nio.ByteBuffer data)
160 throws com.google.protobuf.InvalidProtocolBufferException {
161 return PARSER.parseFrom(data);
164 java.nio.ByteBuffer data,
165 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
166 throws com.google.protobuf.InvalidProtocolBufferException {
167 return PARSER.parseFrom(data, extensionRegistry);
170 com.google.protobuf.ByteString data)
171 throws com.google.protobuf.InvalidProtocolBufferException {
172 return PARSER.parseFrom(data);
175 com.google.protobuf.ByteString data,
176 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
177 throws com.google.protobuf.InvalidProtocolBufferException {
178 return PARSER.parseFrom(data, extensionRegistry);
181 throws com.google.protobuf.InvalidProtocolBufferException {
182 return PARSER.parseFrom(data);
186 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
187 throws com.google.protobuf.InvalidProtocolBufferException {
188 return PARSER.parseFrom(data, extensionRegistry);
191 throws java.io.IOException {
192 return com.google.protobuf.GeneratedMessage
193 .parseWithIOException(PARSER, input);
196 java.io.InputStream input,
197 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
198 throws java.io.IOException {
199 return com.google.protobuf.GeneratedMessage
200 .parseWithIOException(PARSER, input, extensionRegistry);
204 throws java.io.IOException {
205 return com.google.protobuf.GeneratedMessage
206 .parseDelimitedWithIOException(PARSER, input);
210 java.io.InputStream input,
211 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
212 throws java.io.IOException {
213 return com.google.protobuf.GeneratedMessage
214 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
217 com.google.protobuf.CodedInputStream input)
218 throws java.io.IOException {
219 return com.google.protobuf.GeneratedMessage
220 .parseWithIOException(PARSER, input);
223 com.google.protobuf.CodedInputStream input,
224 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
225 throws java.io.IOException {
226 return com.google.protobuf.GeneratedMessage
227 .parseWithIOException(PARSER, input, extensionRegistry);
233 return DEFAULT_INSTANCE.toBuilder();
235 public static Builder newBuilder(com.google.ortools.sat.AllDifferentConstraintProto prototype) {
236 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
240 return this == DEFAULT_INSTANCE
246 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
257 public static final class Builder
extends
258 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
261 public static final com.google.protobuf.Descriptors.Descriptor
263 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_AllDifferentConstraintProto_descriptor;
267 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
269 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_AllDifferentConstraintProto_fieldAccessorTable
270 .ensureFieldAccessorsInitialized(
271 com.google.ortools.sat.AllDifferentConstraintProto.class, com.google.ortools.sat.AllDifferentConstraintProto.Builder.class);
280 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
288 if (exprsBuilder_ ==
null) {
289 exprs_ = java.util.Collections.emptyList();
292 exprsBuilder_.clear();
294 bitField0_ = (bitField0_ & ~0x00000001);
299 public com.google.protobuf.Descriptors.Descriptor
301 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_AllDifferentConstraintProto_descriptor;
306 return com.google.ortools.sat.AllDifferentConstraintProto.getDefaultInstance();
313 throw newUninitializedMessageException(result);
321 buildPartialRepeatedFields(result);
322 if (bitField0_ != 0) { buildPartial0(result); }
327 private void buildPartialRepeatedFields(com.google.ortools.sat.AllDifferentConstraintProto result) {
328 if (exprsBuilder_ ==
null) {
329 if (((bitField0_ & 0x00000001) != 0)) {
330 exprs_ = java.util.Collections.unmodifiableList(exprs_);
331 bitField0_ = (bitField0_ & ~0x00000001);
333 result.exprs_ = exprs_;
335 result.exprs_ = exprsBuilder_.build();
339 private void buildPartial0(com.google.ortools.sat.AllDifferentConstraintProto result) {
340 int from_bitField0_ = bitField0_;
344 public Builder
mergeFrom(com.google.protobuf.Message other) {
345 if (other instanceof com.google.ortools.sat.AllDifferentConstraintProto) {
346 return mergeFrom((com.google.ortools.sat.AllDifferentConstraintProto)other);
348 super.mergeFrom(other);
353 public Builder
mergeFrom(com.google.ortools.sat.AllDifferentConstraintProto other) {
354 if (other == com.google.ortools.sat.AllDifferentConstraintProto.getDefaultInstance())
return this;
355 if (exprsBuilder_ ==
null) {
356 if (!other.exprs_.isEmpty()) {
357 if (exprs_.isEmpty()) {
358 exprs_ = other.exprs_;
359 bitField0_ = (bitField0_ & ~0x00000001);
361 ensureExprsIsMutable();
362 exprs_.addAll(other.exprs_);
367 if (!other.exprs_.isEmpty()) {
368 if (exprsBuilder_.isEmpty()) {
369 exprsBuilder_.dispose();
370 exprsBuilder_ =
null;
371 exprs_ = other.exprs_;
372 bitField0_ = (bitField0_ & ~0x00000001);
374 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
375 getExprsFieldBuilder() :
null;
377 exprsBuilder_.addAllMessages(other.exprs_);
381 this.mergeUnknownFields(other.getUnknownFields());
393 com.google.protobuf.CodedInputStream input,
394 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
395 throws java.io.IOException {
396 if (extensionRegistry ==
null) {
397 throw new java.lang.NullPointerException();
400 boolean done =
false;
402 int tag = input.readTag();
410 com.google.ortools.sat.LinearExpressionProto.parser(),
412 if (exprsBuilder_ ==
null) {
413 ensureExprsIsMutable();
416 exprsBuilder_.addMessage(m);
421 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
428 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
429 throw e.unwrapIOException();
435 private int bitField0_;
437 private java.util.List<com.google.ortools.sat.LinearExpressionProto> exprs_ =
438 java.util.Collections.emptyList();
439 private void ensureExprsIsMutable() {
440 if (!((bitField0_ & 0x00000001) != 0)) {
441 exprs_ =
new java.util.ArrayList<com.google.ortools.sat.LinearExpressionProto>(exprs_);
442 bitField0_ |= 0x00000001;
446 private com.google.protobuf.RepeatedFieldBuilder<
447 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> exprsBuilder_;
452 public java.util.List<com.google.ortools.sat.LinearExpressionProto>
getExprsList() {
453 if (exprsBuilder_ ==
null) {
454 return java.util.Collections.unmodifiableList(exprs_);
456 return exprsBuilder_.getMessageList();
463 if (exprsBuilder_ ==
null) {
464 return exprs_.size();
466 return exprsBuilder_.getCount();
473 if (exprsBuilder_ ==
null) {
474 return exprs_.get(index);
476 return exprsBuilder_.getMessage(index);
483 int index, com.google.ortools.sat.LinearExpressionProto value) {
484 if (exprsBuilder_ ==
null) {
486 throw new NullPointerException();
488 ensureExprsIsMutable();
489 exprs_.set(index, value);
492 exprsBuilder_.setMessage(index, value);
500 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
501 if (exprsBuilder_ ==
null) {
502 ensureExprsIsMutable();
503 exprs_.set(index, builderForValue.build());
506 exprsBuilder_.setMessage(index, builderForValue.build());
513 public Builder
addExprs(com.google.ortools.sat.LinearExpressionProto value) {
514 if (exprsBuilder_ ==
null) {
516 throw new NullPointerException();
518 ensureExprsIsMutable();
522 exprsBuilder_.addMessage(value);
530 int index, com.google.ortools.sat.LinearExpressionProto value) {
531 if (exprsBuilder_ ==
null) {
533 throw new NullPointerException();
535 ensureExprsIsMutable();
536 exprs_.add(index, value);
539 exprsBuilder_.addMessage(index, value);
547 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
548 if (exprsBuilder_ ==
null) {
549 ensureExprsIsMutable();
550 exprs_.add(builderForValue.build());
553 exprsBuilder_.addMessage(builderForValue.build());
561 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
562 if (exprsBuilder_ ==
null) {
563 ensureExprsIsMutable();
564 exprs_.add(index, builderForValue.build());
567 exprsBuilder_.addMessage(index, builderForValue.build());
575 java.lang.Iterable<? extends com.google.ortools.sat.LinearExpressionProto> values) {
576 if (exprsBuilder_ ==
null) {
577 ensureExprsIsMutable();
578 com.google.protobuf.AbstractMessageLite.Builder.addAll(
582 exprsBuilder_.addAllMessages(values);
590 if (exprsBuilder_ ==
null) {
591 exprs_ = java.util.Collections.emptyList();
592 bitField0_ = (bitField0_ & ~0x00000001);
595 exprsBuilder_.clear();
603 if (exprsBuilder_ ==
null) {
604 ensureExprsIsMutable();
605 exprs_.remove(index);
608 exprsBuilder_.remove(index);
617 return getExprsFieldBuilder().getBuilder(index);
624 if (exprsBuilder_ ==
null) {
625 return exprs_.get(index); }
else {
626 return exprsBuilder_.getMessageOrBuilder(index);
632 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
634 if (exprsBuilder_ !=
null) {
635 return exprsBuilder_.getMessageOrBuilderList();
637 return java.util.Collections.unmodifiableList(exprs_);
644 return getExprsFieldBuilder().addBuilder(
645 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
652 return getExprsFieldBuilder().addBuilder(
653 index, com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
658 public java.util.List<com.google.ortools.sat.LinearExpressionProto.Builder>
660 return getExprsFieldBuilder().getBuilderList();
662 private com.google.protobuf.RepeatedFieldBuilder<
663 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>
664 getExprsFieldBuilder() {
665 if (exprsBuilder_ ==
null) {
666 exprsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilder<
667 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>(
669 ((bitField0_ & 0x00000001) != 0),
670 getParentForChildren(),
674 return exprsBuilder_;
683 DEFAULT_INSTANCE =
new com.google.ortools.sat.AllDifferentConstraintProto();
687 return DEFAULT_INSTANCE;
694 com.google.protobuf.CodedInputStream input,
695 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
696 throws com.google.protobuf.InvalidProtocolBufferException {
699 builder.mergeFrom(input, extensionRegistry);
700 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
701 throw e.setUnfinishedMessage(builder.buildPartial());
702 }
catch (com.google.protobuf.UninitializedMessageException e) {
703 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
704 }
catch (java.io.IOException e) {
705 throw new com.google.protobuf.InvalidProtocolBufferException(e)
706 .setUnfinishedMessage(builder.buildPartial());
708 return builder.buildPartial();
712 public static com.google.protobuf.Parser<AllDifferentConstraintProto>
parser() {
723 return DEFAULT_INSTANCE;