6package com.google.ortools.sat;
33@com.google.protobuf.Generated
34public final class IntegerVariableProto
extends
35 com.google.protobuf.GeneratedMessage implements
38private static final long serialVersionUID = 0L;
40 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
41 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
46 IntegerVariableProto.class.getName());
49 private IntegerVariableProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
52 private IntegerVariableProto() {
54 domain_ = emptyLongList();
57 public static final com.google.protobuf.Descriptors.Descriptor
59 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_descriptor;
63 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
65 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_fieldAccessorTable
66 .ensureFieldAccessorsInitialized(
67 com.google.ortools.sat.IntegerVariableProto.class, com.google.ortools.sat.IntegerVariableProto.Builder.class);
71 @SuppressWarnings(
"serial")
72 private volatile java.lang.Object name_ =
"";
83 java.lang.Object ref = name_;
84 if (ref instanceof java.lang.String) {
85 return (java.lang.String) ref;
87 com.google.protobuf.ByteString bs =
88 (com.google.protobuf.ByteString) ref;
89 java.lang.String s = bs.toStringUtf8();
103 public com.google.protobuf.ByteString
105 java.lang.Object ref = name_;
106 if (ref instanceof java.lang.String) {
107 com.google.protobuf.ByteString b =
108 com.google.protobuf.ByteString.copyFromUtf8(
109 (java.lang.String) ref);
113 return (com.google.protobuf.ByteString) ref;
118 @SuppressWarnings(
"serial")
119 private com.google.protobuf.Internal.LongList domain_ =
146 public java.
util.List<java.lang.Long>
175 return domain_.size();
203 return domain_.getLong(index);
205 private int domainMemoizedSerializedSize = -1;
207 private byte memoizedIsInitialized = -1;
214 memoizedIsInitialized = 1;
219 public void writeTo(com.google.protobuf.CodedOutputStream output)
220 throws java.io.IOException {
222 if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
223 com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
226 output.writeUInt32NoTag(18);
227 output.writeUInt32NoTag(domainMemoizedSerializedSize);
229 for (
int i = 0; i < domain_.size(); i++) {
230 output.writeInt64NoTag(domain_.getLong(i));
232 getUnknownFields().writeTo(output);
237 int size = memoizedSize;
238 if (size != -1)
return size;
241 if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
242 size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
246 for (
int i = 0; i < domain_.size(); i++) {
247 dataSize += com.google.protobuf.CodedOutputStream
248 .computeInt64SizeNoTag(domain_.getLong(i));
253 size += com.google.protobuf.CodedOutputStream
254 .computeInt32SizeNoTag(dataSize);
256 domainMemoizedSerializedSize = dataSize;
258 size += getUnknownFields().getSerializedSize();
264 public boolean equals(
final java.lang.Object obj) {
268 if (!(obj instanceof com.google.ortools.sat.IntegerVariableProto)) {
269 return super.equals(obj);
277 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
283 if (memoizedHashCode != 0) {
284 return memoizedHashCode;
289 hash = (53 * hash) +
getName().hashCode();
294 hash = (29 * hash) + getUnknownFields().hashCode();
295 memoizedHashCode = hash;
300 java.nio.ByteBuffer data)
301 throws com.google.protobuf.InvalidProtocolBufferException {
302 return PARSER.parseFrom(data);
305 java.nio.ByteBuffer data,
306 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
307 throws com.google.protobuf.InvalidProtocolBufferException {
308 return PARSER.parseFrom(data, extensionRegistry);
311 com.google.protobuf.ByteString data)
312 throws com.google.protobuf.InvalidProtocolBufferException {
313 return PARSER.parseFrom(data);
316 com.google.protobuf.ByteString data,
317 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
318 throws com.google.protobuf.InvalidProtocolBufferException {
319 return PARSER.parseFrom(data, extensionRegistry);
322 throws com.google.protobuf.InvalidProtocolBufferException {
323 return PARSER.parseFrom(data);
327 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
328 throws com.google.protobuf.InvalidProtocolBufferException {
329 return PARSER.parseFrom(data, extensionRegistry);
332 throws java.io.IOException {
333 return com.google.protobuf.GeneratedMessage
334 .parseWithIOException(PARSER, input);
337 java.io.InputStream input,
338 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
339 throws java.io.IOException {
340 return com.google.protobuf.GeneratedMessage
341 .parseWithIOException(PARSER, input, extensionRegistry);
345 throws java.io.IOException {
346 return com.google.protobuf.GeneratedMessage
347 .parseDelimitedWithIOException(PARSER, input);
351 java.io.InputStream input,
352 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
353 throws java.io.IOException {
354 return com.google.protobuf.GeneratedMessage
355 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
358 com.google.protobuf.CodedInputStream input)
359 throws java.io.IOException {
360 return com.google.protobuf.GeneratedMessage
361 .parseWithIOException(PARSER, input);
364 com.google.protobuf.CodedInputStream input,
365 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
366 throws java.io.IOException {
367 return com.google.protobuf.GeneratedMessage
368 .parseWithIOException(PARSER, input, extensionRegistry);
374 return DEFAULT_INSTANCE.toBuilder();
377 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
381 return this == DEFAULT_INSTANCE
387 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
416 public static final class Builder
extends
417 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
420 public static final com.google.protobuf.Descriptors.Descriptor
422 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_descriptor;
426 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
428 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_fieldAccessorTable
429 .ensureFieldAccessorsInitialized(
430 com.google.ortools.sat.IntegerVariableProto.class, com.google.ortools.sat.IntegerVariableProto.Builder.class);
439 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
448 domain_ = emptyLongList();
453 public com.google.protobuf.Descriptors.Descriptor
455 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_descriptor;
460 return com.google.ortools.sat.IntegerVariableProto.getDefaultInstance();
467 throw newUninitializedMessageException(result);
475 if (bitField0_ != 0) { buildPartial0(result); }
480 private void buildPartial0(com.google.ortools.sat.IntegerVariableProto result) {
481 int from_bitField0_ = bitField0_;
482 if (((from_bitField0_ & 0x00000001) != 0)) {
483 result.name_ = name_;
485 if (((from_bitField0_ & 0x00000002) != 0)) {
486 domain_.makeImmutable();
487 result.domain_ = domain_;
492 public Builder
mergeFrom(com.google.protobuf.Message other) {
493 if (other instanceof com.google.ortools.sat.IntegerVariableProto) {
494 return mergeFrom((com.google.ortools.sat.IntegerVariableProto)other);
496 super.mergeFrom(other);
501 public Builder
mergeFrom(com.google.ortools.sat.IntegerVariableProto other) {
502 if (other == com.google.ortools.sat.IntegerVariableProto.getDefaultInstance())
return this;
503 if (!other.getName().isEmpty()) {
505 bitField0_ |= 0x00000001;
508 if (!other.domain_.isEmpty()) {
509 if (domain_.isEmpty()) {
510 domain_ = other.domain_;
511 domain_.makeImmutable();
512 bitField0_ |= 0x00000002;
514 ensureDomainIsMutable();
515 domain_.addAll(other.domain_);
519 this.mergeUnknownFields(other.getUnknownFields());
531 com.google.protobuf.CodedInputStream input,
532 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
533 throws java.io.IOException {
534 if (extensionRegistry ==
null) {
535 throw new java.lang.NullPointerException();
538 boolean done =
false;
540 int tag = input.readTag();
546 name_ = input.readStringRequireUtf8();
547 bitField0_ |= 0x00000001;
551 long v = input.readInt64();
552 ensureDomainIsMutable();
557 int length = input.readRawVarint32();
558 int limit = input.pushLimit(length);
559 ensureDomainIsMutable();
560 while (input.getBytesUntilLimit() > 0) {
561 domain_.addLong(input.readInt64());
563 input.popLimit(limit);
567 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
574 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
575 throw e.unwrapIOException();
581 private int bitField0_;
583 private java.lang.Object name_ =
"";
593 java.lang.Object ref = name_;
594 if (!(ref instanceof java.lang.String)) {
595 com.google.protobuf.ByteString bs =
596 (com.google.protobuf.ByteString) ref;
597 java.lang.String s = bs.toStringUtf8();
601 return (java.lang.String) ref;
612 public com.google.protobuf.ByteString
614 java.lang.Object ref = name_;
615 if (ref instanceof String) {
616 com.google.protobuf.ByteString b =
617 com.google.protobuf.ByteString.copyFromUtf8(
618 (java.lang.String) ref);
622 return (com.google.protobuf.ByteString) ref;
635 java.lang.String value) {
636 if (value ==
null) {
throw new NullPointerException(); }
638 bitField0_ |= 0x00000001;
652 bitField0_ = (bitField0_ & ~0x00000001);
666 com.google.protobuf.ByteString value) {
667 if (value ==
null) {
throw new NullPointerException(); }
668 checkByteStringIsUtf8(value);
670 bitField0_ |= 0x00000001;
675 private com.google.protobuf.Internal.LongList domain_ = emptyLongList();
676 private void ensureDomainIsMutable() {
677 if (!domain_.isModifiable()) {
678 domain_ = makeMutableCopy(domain_);
680 bitField0_ |= 0x00000002;
706 public java.util.List<java.lang.Long>
708 domain_.makeImmutable();
736 return domain_.size();
764 return domain_.getLong(index);
793 int index,
long value) {
795 ensureDomainIsMutable();
796 domain_.setLong(index, value);
797 bitField0_ |= 0x00000002;
828 ensureDomainIsMutable();
829 domain_.addLong(value);
830 bitField0_ |= 0x00000002;
860 java.lang.Iterable<? extends java.lang.Long> values) {
861 ensureDomainIsMutable();
862 com.google.protobuf.AbstractMessageLite.Builder.addAll(
864 bitField0_ |= 0x00000002;
893 domain_ = emptyLongList();
894 bitField0_ = (bitField0_ & ~0x00000002);
905 DEFAULT_INSTANCE =
new com.google.ortools.sat.IntegerVariableProto();
909 return DEFAULT_INSTANCE;
916 com.google.protobuf.CodedInputStream input,
917 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
918 throws com.google.protobuf.InvalidProtocolBufferException {
921 builder.mergeFrom(input, extensionRegistry);
922 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
923 throw e.setUnfinishedMessage(builder.buildPartial());
924 }
catch (com.google.protobuf.UninitializedMessageException e) {
925 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
926 }
catch (java.io.IOException e) {
927 throw new com.google.protobuf.InvalidProtocolBufferException(e)
928 .setUnfinishedMessage(builder.buildPartial());
930 return builder.buildPartial();
934 public static com.google.protobuf.Parser<IntegerVariableProto>
parser() {
945 return DEFAULT_INSTANCE;