6package com.google.ortools.sat;
15@com.google.protobuf.Generated
16public final class AllDifferentConstraintProto
extends
17 com.google.protobuf.GeneratedMessage implements
20private static final long serialVersionUID = 0L;
22 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
23 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
28 AllDifferentConstraintProto.class.getName());
31 private AllDifferentConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
34 private AllDifferentConstraintProto() {
35 exprs_ = java.util.Collections.emptyList();
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_AllDifferentConstraintProto_descriptor;
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_AllDifferentConstraintProto_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.sat.AllDifferentConstraintProto.class, com.google.ortools.sat.AllDifferentConstraintProto.Builder.class);
52 @SuppressWarnings(
"serial")
65 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
81 return exprs_.get(index);
89 return exprs_.get(index);
92 private byte memoizedIsInitialized = -1;
99 memoizedIsInitialized = 1;
104 public void writeTo(com.google.protobuf.CodedOutputStream output)
105 throws java.io.IOException {
106 for (
int i = 0; i < exprs_.size(); i++) {
107 output.writeMessage(1, exprs_.get(i));
109 getUnknownFields().writeTo(output);
114 int size = memoizedSize;
115 if (size != -1)
return size;
118 for (
int i = 0; i < exprs_.size(); i++) {
119 size += com.google.protobuf.CodedOutputStream
120 .computeMessageSize(1, exprs_.get(i));
122 size += getUnknownFields().getSerializedSize();
128 public boolean equals(
final java.lang.Object obj) {
132 if (!(obj instanceof com.google.ortools.sat.AllDifferentConstraintProto)) {
133 return super.equals(obj);
139 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
145 if (memoizedHashCode != 0) {
146 return memoizedHashCode;
154 hash = (29 * hash) + getUnknownFields().hashCode();
155 memoizedHashCode = hash;
160 java.nio.ByteBuffer data)
161 throws com.google.protobuf.InvalidProtocolBufferException {
162 return PARSER.parseFrom(data);
165 java.nio.ByteBuffer data,
166 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
167 throws com.google.protobuf.InvalidProtocolBufferException {
168 return PARSER.parseFrom(data, extensionRegistry);
171 com.google.protobuf.ByteString data)
172 throws com.google.protobuf.InvalidProtocolBufferException {
173 return PARSER.parseFrom(data);
176 com.google.protobuf.ByteString data,
177 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
178 throws com.google.protobuf.InvalidProtocolBufferException {
179 return PARSER.parseFrom(data, extensionRegistry);
182 throws com.google.protobuf.InvalidProtocolBufferException {
183 return PARSER.parseFrom(data);
187 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
188 throws com.google.protobuf.InvalidProtocolBufferException {
189 return PARSER.parseFrom(data, extensionRegistry);
192 throws java.io.IOException {
193 return com.google.protobuf.GeneratedMessage
194 .parseWithIOException(PARSER, input);
197 java.io.InputStream input,
198 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
199 throws java.io.IOException {
200 return com.google.protobuf.GeneratedMessage
201 .parseWithIOException(PARSER, input, extensionRegistry);
205 throws java.io.IOException {
206 return com.google.protobuf.GeneratedMessage
207 .parseDelimitedWithIOException(PARSER, input);
211 java.io.InputStream input,
212 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
213 throws java.io.IOException {
214 return com.google.protobuf.GeneratedMessage
215 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
218 com.google.protobuf.CodedInputStream input)
219 throws java.io.IOException {
220 return com.google.protobuf.GeneratedMessage
221 .parseWithIOException(PARSER, input);
224 com.google.protobuf.CodedInputStream input,
225 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
226 throws java.io.IOException {
227 return com.google.protobuf.GeneratedMessage
228 .parseWithIOException(PARSER, input, extensionRegistry);
234 return DEFAULT_INSTANCE.toBuilder();
236 public static Builder newBuilder(com.google.ortools.sat.AllDifferentConstraintProto prototype) {
237 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
241 return this == DEFAULT_INSTANCE
247 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
258 public static final class Builder
extends
259 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
262 public static final com.google.protobuf.Descriptors.Descriptor
264 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_AllDifferentConstraintProto_descriptor;
268 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
270 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_AllDifferentConstraintProto_fieldAccessorTable
271 .ensureFieldAccessorsInitialized(
272 com.google.ortools.sat.AllDifferentConstraintProto.class, com.google.ortools.sat.AllDifferentConstraintProto.Builder.class);
281 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
289 if (exprsBuilder_ ==
null) {
290 exprs_ = java.util.Collections.emptyList();
293 exprsBuilder_.clear();
295 bitField0_ = (bitField0_ & ~0x00000001);
300 public com.google.protobuf.Descriptors.Descriptor
302 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_AllDifferentConstraintProto_descriptor;
307 return com.google.ortools.sat.AllDifferentConstraintProto.getDefaultInstance();
314 throw newUninitializedMessageException(result);
322 buildPartialRepeatedFields(result);
323 if (bitField0_ != 0) { buildPartial0(result); }
328 private void buildPartialRepeatedFields(com.google.ortools.sat.AllDifferentConstraintProto result) {
329 if (exprsBuilder_ ==
null) {
330 if (((bitField0_ & 0x00000001) != 0)) {
331 exprs_ = java.util.Collections.unmodifiableList(exprs_);
332 bitField0_ = (bitField0_ & ~0x00000001);
334 result.exprs_ = exprs_;
336 result.exprs_ = exprsBuilder_.build();
340 private void buildPartial0(com.google.ortools.sat.AllDifferentConstraintProto result) {
341 int from_bitField0_ = bitField0_;
345 public Builder
mergeFrom(com.google.protobuf.Message other) {
346 if (other instanceof com.google.ortools.sat.AllDifferentConstraintProto) {
347 return mergeFrom((com.google.ortools.sat.AllDifferentConstraintProto)other);
349 super.mergeFrom(other);
354 public Builder
mergeFrom(com.google.ortools.sat.AllDifferentConstraintProto other) {
355 if (other == com.google.ortools.sat.AllDifferentConstraintProto.getDefaultInstance())
return this;
356 if (exprsBuilder_ ==
null) {
357 if (!other.exprs_.isEmpty()) {
358 if (exprs_.isEmpty()) {
359 exprs_ = other.exprs_;
360 bitField0_ = (bitField0_ & ~0x00000001);
362 ensureExprsIsMutable();
363 exprs_.addAll(other.exprs_);
368 if (!other.exprs_.isEmpty()) {
369 if (exprsBuilder_.isEmpty()) {
370 exprsBuilder_.dispose();
371 exprsBuilder_ =
null;
372 exprs_ = other.exprs_;
373 bitField0_ = (bitField0_ & ~0x00000001);
375 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
376 internalGetExprsFieldBuilder() :
null;
378 exprsBuilder_.addAllMessages(other.exprs_);
382 this.mergeUnknownFields(other.getUnknownFields());
394 com.google.protobuf.CodedInputStream input,
395 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
396 throws java.io.IOException {
397 if (extensionRegistry ==
null) {
398 throw new java.lang.NullPointerException();
401 boolean done =
false;
403 int tag = input.readTag();
411 com.google.ortools.sat.LinearExpressionProto.parser(),
413 if (exprsBuilder_ ==
null) {
414 ensureExprsIsMutable();
417 exprsBuilder_.addMessage(m);
422 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
429 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
430 throw e.unwrapIOException();
436 private int bitField0_;
438 private java.util.List<com.google.ortools.sat.LinearExpressionProto> exprs_ =
439 java.util.Collections.emptyList();
440 private void ensureExprsIsMutable() {
441 if (!((bitField0_ & 0x00000001) != 0)) {
442 exprs_ =
new java.util.ArrayList<com.google.ortools.sat.LinearExpressionProto>(exprs_);
443 bitField0_ |= 0x00000001;
447 private com.google.protobuf.RepeatedFieldBuilder<
448 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> exprsBuilder_;
453 public java.util.List<com.google.ortools.sat.LinearExpressionProto>
getExprsList() {
454 if (exprsBuilder_ ==
null) {
455 return java.util.Collections.unmodifiableList(exprs_);
457 return exprsBuilder_.getMessageList();
464 if (exprsBuilder_ ==
null) {
465 return exprs_.size();
467 return exprsBuilder_.getCount();
474 if (exprsBuilder_ ==
null) {
475 return exprs_.get(index);
477 return exprsBuilder_.getMessage(index);
484 int index, com.google.ortools.sat.LinearExpressionProto value) {
485 if (exprsBuilder_ ==
null) {
487 throw new NullPointerException();
489 ensureExprsIsMutable();
490 exprs_.set(index, value);
493 exprsBuilder_.setMessage(index, value);
501 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
502 if (exprsBuilder_ ==
null) {
503 ensureExprsIsMutable();
504 exprs_.set(index, builderForValue.build());
507 exprsBuilder_.setMessage(index, builderForValue.build());
514 public Builder
addExprs(com.google.ortools.sat.LinearExpressionProto value) {
515 if (exprsBuilder_ ==
null) {
517 throw new NullPointerException();
519 ensureExprsIsMutable();
523 exprsBuilder_.addMessage(value);
531 int index, com.google.ortools.sat.LinearExpressionProto value) {
532 if (exprsBuilder_ ==
null) {
534 throw new NullPointerException();
536 ensureExprsIsMutable();
537 exprs_.add(index, value);
540 exprsBuilder_.addMessage(index, value);
548 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
549 if (exprsBuilder_ ==
null) {
550 ensureExprsIsMutable();
551 exprs_.add(builderForValue.build());
554 exprsBuilder_.addMessage(builderForValue.build());
562 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
563 if (exprsBuilder_ ==
null) {
564 ensureExprsIsMutable();
565 exprs_.add(index, builderForValue.build());
568 exprsBuilder_.addMessage(index, builderForValue.build());
576 java.lang.Iterable<? extends com.google.ortools.sat.LinearExpressionProto> values) {
577 if (exprsBuilder_ ==
null) {
578 ensureExprsIsMutable();
579 com.google.protobuf.AbstractMessageLite.Builder.addAll(
583 exprsBuilder_.addAllMessages(values);
591 if (exprsBuilder_ ==
null) {
592 exprs_ = java.util.Collections.emptyList();
593 bitField0_ = (bitField0_ & ~0x00000001);
596 exprsBuilder_.clear();
604 if (exprsBuilder_ ==
null) {
605 ensureExprsIsMutable();
606 exprs_.remove(index);
609 exprsBuilder_.remove(index);
618 return internalGetExprsFieldBuilder().getBuilder(index);
625 if (exprsBuilder_ ==
null) {
626 return exprs_.get(index); }
else {
627 return exprsBuilder_.getMessageOrBuilder(index);
633 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
635 if (exprsBuilder_ !=
null) {
636 return exprsBuilder_.getMessageOrBuilderList();
638 return java.util.Collections.unmodifiableList(exprs_);
645 return internalGetExprsFieldBuilder().addBuilder(
646 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
653 return internalGetExprsFieldBuilder().addBuilder(
654 index, com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
659 public java.util.List<com.google.ortools.sat.LinearExpressionProto.Builder>
661 return internalGetExprsFieldBuilder().getBuilderList();
663 private com.google.protobuf.RepeatedFieldBuilder<
664 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>
665 internalGetExprsFieldBuilder() {
666 if (exprsBuilder_ ==
null) {
667 exprsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilder<
668 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>(
670 ((bitField0_ & 0x00000001) != 0),
671 getParentForChildren(),
675 return exprsBuilder_;
684 DEFAULT_INSTANCE =
new com.google.ortools.sat.AllDifferentConstraintProto();
688 return DEFAULT_INSTANCE;
695 com.google.protobuf.CodedInputStream input,
696 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
697 throws com.google.protobuf.InvalidProtocolBufferException {
700 builder.mergeFrom(input, extensionRegistry);
701 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
702 throw e.setUnfinishedMessage(builder.buildPartial());
703 }
catch (com.google.protobuf.UninitializedMessageException e) {
704 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
705 }
catch (java.io.IOException e) {
706 throw new com.google.protobuf.InvalidProtocolBufferException(e)
707 .setUnfinishedMessage(builder.buildPartial());
709 return builder.buildPartial();
713 public static com.google.protobuf.Parser<AllDifferentConstraintProto>
parser() {
724 return DEFAULT_INSTANCE;