6package com.google.ortools.sat;
33public final class IntegerVariableProto
extends
34 com.google.protobuf.GeneratedMessage implements
37private static final long serialVersionUID = 0L;
39 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
40 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
45 IntegerVariableProto.class.getName());
48 private IntegerVariableProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
51 private IntegerVariableProto() {
53 domain_ = emptyLongList();
56 public static final com.google.protobuf.Descriptors.Descriptor
58 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_descriptor;
62 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
64 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_fieldAccessorTable
65 .ensureFieldAccessorsInitialized(
66 com.google.ortools.sat.IntegerVariableProto.class, com.google.ortools.sat.IntegerVariableProto.Builder.class);
70 @SuppressWarnings(
"serial")
71 private volatile java.lang.Object name_ =
"";
82 java.lang.Object ref = name_;
83 if (ref instanceof java.lang.String) {
84 return (java.lang.String) ref;
86 com.google.protobuf.ByteString bs =
87 (com.google.protobuf.ByteString) ref;
88 java.lang.String s = bs.toStringUtf8();
102 public com.google.protobuf.ByteString
104 java.lang.Object ref = name_;
105 if (ref instanceof java.lang.String) {
106 com.google.protobuf.ByteString b =
107 com.google.protobuf.ByteString.copyFromUtf8(
108 (java.lang.String) ref);
112 return (com.google.protobuf.ByteString) ref;
117 @SuppressWarnings(
"serial")
118 private com.google.protobuf.Internal.LongList domain_ =
145 public java.
util.List<java.lang.Long>
174 return domain_.size();
202 return domain_.getLong(index);
204 private int domainMemoizedSerializedSize = -1;
206 private byte memoizedIsInitialized = -1;
213 memoizedIsInitialized = 1;
218 public void writeTo(com.google.protobuf.CodedOutputStream output)
219 throws java.io.IOException {
221 if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
222 com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
225 output.writeUInt32NoTag(18);
226 output.writeUInt32NoTag(domainMemoizedSerializedSize);
228 for (
int i = 0; i < domain_.size(); i++) {
229 output.writeInt64NoTag(domain_.getLong(i));
231 getUnknownFields().writeTo(output);
236 int size = memoizedSize;
237 if (size != -1)
return size;
240 if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
241 size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
245 for (
int i = 0; i < domain_.size(); i++) {
246 dataSize += com.google.protobuf.CodedOutputStream
247 .computeInt64SizeNoTag(domain_.getLong(i));
252 size += com.google.protobuf.CodedOutputStream
253 .computeInt32SizeNoTag(dataSize);
255 domainMemoizedSerializedSize = dataSize;
257 size += getUnknownFields().getSerializedSize();
263 public boolean equals(
final java.lang.Object obj) {
267 if (!(obj instanceof com.google.ortools.sat.IntegerVariableProto)) {
268 return super.equals(obj);
276 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
282 if (memoizedHashCode != 0) {
283 return memoizedHashCode;
288 hash = (53 * hash) +
getName().hashCode();
293 hash = (29 * hash) + getUnknownFields().hashCode();
294 memoizedHashCode = hash;
299 java.nio.ByteBuffer data)
300 throws com.google.protobuf.InvalidProtocolBufferException {
301 return PARSER.parseFrom(data);
304 java.nio.ByteBuffer data,
305 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
306 throws com.google.protobuf.InvalidProtocolBufferException {
307 return PARSER.parseFrom(data, extensionRegistry);
310 com.google.protobuf.ByteString data)
311 throws com.google.protobuf.InvalidProtocolBufferException {
312 return PARSER.parseFrom(data);
315 com.google.protobuf.ByteString data,
316 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
317 throws com.google.protobuf.InvalidProtocolBufferException {
318 return PARSER.parseFrom(data, extensionRegistry);
321 throws com.google.protobuf.InvalidProtocolBufferException {
322 return PARSER.parseFrom(data);
326 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
327 throws com.google.protobuf.InvalidProtocolBufferException {
328 return PARSER.parseFrom(data, extensionRegistry);
331 throws java.io.IOException {
332 return com.google.protobuf.GeneratedMessage
333 .parseWithIOException(PARSER, input);
336 java.io.InputStream input,
337 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
338 throws java.io.IOException {
339 return com.google.protobuf.GeneratedMessage
340 .parseWithIOException(PARSER, input, extensionRegistry);
344 throws java.io.IOException {
345 return com.google.protobuf.GeneratedMessage
346 .parseDelimitedWithIOException(PARSER, input);
350 java.io.InputStream input,
351 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
352 throws java.io.IOException {
353 return com.google.protobuf.GeneratedMessage
354 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
357 com.google.protobuf.CodedInputStream input)
358 throws java.io.IOException {
359 return com.google.protobuf.GeneratedMessage
360 .parseWithIOException(PARSER, input);
363 com.google.protobuf.CodedInputStream input,
364 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
365 throws java.io.IOException {
366 return com.google.protobuf.GeneratedMessage
367 .parseWithIOException(PARSER, input, extensionRegistry);
373 return DEFAULT_INSTANCE.toBuilder();
376 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
380 return this == DEFAULT_INSTANCE
386 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
415 public static final class Builder
extends
416 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
419 public static final com.google.protobuf.Descriptors.Descriptor
421 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_descriptor;
425 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
427 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_fieldAccessorTable
428 .ensureFieldAccessorsInitialized(
429 com.google.ortools.sat.IntegerVariableProto.class, com.google.ortools.sat.IntegerVariableProto.Builder.class);
438 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
447 domain_ = emptyLongList();
452 public com.google.protobuf.Descriptors.Descriptor
454 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_descriptor;
459 return com.google.ortools.sat.IntegerVariableProto.getDefaultInstance();
466 throw newUninitializedMessageException(result);
474 if (bitField0_ != 0) { buildPartial0(result); }
479 private void buildPartial0(com.google.ortools.sat.IntegerVariableProto result) {
480 int from_bitField0_ = bitField0_;
481 if (((from_bitField0_ & 0x00000001) != 0)) {
482 result.name_ = name_;
484 if (((from_bitField0_ & 0x00000002) != 0)) {
485 domain_.makeImmutable();
486 result.domain_ = domain_;
491 public Builder
mergeFrom(com.google.protobuf.Message other) {
492 if (other instanceof com.google.ortools.sat.IntegerVariableProto) {
493 return mergeFrom((com.google.ortools.sat.IntegerVariableProto)other);
495 super.mergeFrom(other);
500 public Builder
mergeFrom(com.google.ortools.sat.IntegerVariableProto other) {
501 if (other == com.google.ortools.sat.IntegerVariableProto.getDefaultInstance())
return this;
502 if (!other.getName().isEmpty()) {
504 bitField0_ |= 0x00000001;
507 if (!other.domain_.isEmpty()) {
508 if (domain_.isEmpty()) {
509 domain_ = other.domain_;
510 domain_.makeImmutable();
511 bitField0_ |= 0x00000002;
513 ensureDomainIsMutable();
514 domain_.addAll(other.domain_);
518 this.mergeUnknownFields(other.getUnknownFields());
530 com.google.protobuf.CodedInputStream input,
531 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
532 throws java.io.IOException {
533 if (extensionRegistry ==
null) {
534 throw new java.lang.NullPointerException();
537 boolean done =
false;
539 int tag = input.readTag();
545 name_ = input.readStringRequireUtf8();
546 bitField0_ |= 0x00000001;
550 long v = input.readInt64();
551 ensureDomainIsMutable();
556 int length = input.readRawVarint32();
557 int limit = input.pushLimit(length);
558 ensureDomainIsMutable();
559 while (input.getBytesUntilLimit() > 0) {
560 domain_.addLong(input.readInt64());
562 input.popLimit(limit);
566 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
573 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
574 throw e.unwrapIOException();
580 private int bitField0_;
582 private java.lang.Object name_ =
"";
592 java.lang.Object ref = name_;
593 if (!(ref instanceof java.lang.String)) {
594 com.google.protobuf.ByteString bs =
595 (com.google.protobuf.ByteString) ref;
596 java.lang.String s = bs.toStringUtf8();
600 return (java.lang.String) ref;
611 public com.google.protobuf.ByteString
613 java.lang.Object ref = name_;
614 if (ref instanceof String) {
615 com.google.protobuf.ByteString b =
616 com.google.protobuf.ByteString.copyFromUtf8(
617 (java.lang.String) ref);
621 return (com.google.protobuf.ByteString) ref;
634 java.lang.String value) {
635 if (value ==
null) {
throw new NullPointerException(); }
637 bitField0_ |= 0x00000001;
651 bitField0_ = (bitField0_ & ~0x00000001);
665 com.google.protobuf.ByteString value) {
666 if (value ==
null) {
throw new NullPointerException(); }
667 checkByteStringIsUtf8(value);
669 bitField0_ |= 0x00000001;
674 private com.google.protobuf.Internal.LongList domain_ = emptyLongList();
675 private void ensureDomainIsMutable() {
676 if (!domain_.isModifiable()) {
677 domain_ = makeMutableCopy(domain_);
679 bitField0_ |= 0x00000002;
705 public java.util.List<java.lang.Long>
707 domain_.makeImmutable();
735 return domain_.size();
763 return domain_.getLong(index);
792 int index,
long value) {
794 ensureDomainIsMutable();
795 domain_.setLong(index, value);
796 bitField0_ |= 0x00000002;
827 ensureDomainIsMutable();
828 domain_.addLong(value);
829 bitField0_ |= 0x00000002;
859 java.lang.Iterable<? extends java.lang.Long> values) {
860 ensureDomainIsMutable();
861 com.google.protobuf.AbstractMessageLite.Builder.addAll(
863 bitField0_ |= 0x00000002;
892 domain_ = emptyLongList();
893 bitField0_ = (bitField0_ & ~0x00000002);
904 DEFAULT_INSTANCE =
new com.google.ortools.sat.IntegerVariableProto();
908 return DEFAULT_INSTANCE;
915 com.google.protobuf.CodedInputStream input,
916 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
917 throws com.google.protobuf.InvalidProtocolBufferException {
920 builder.mergeFrom(input, extensionRegistry);
921 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
922 throw e.setUnfinishedMessage(builder.buildPartial());
923 }
catch (com.google.protobuf.UninitializedMessageException e) {
924 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
925 }
catch (java.io.IOException e) {
926 throw new com.google.protobuf.InvalidProtocolBufferException(e)
927 .setUnfinishedMessage(builder.buildPartial());
929 return builder.buildPartial();
933 public static com.google.protobuf.Parser<IntegerVariableProto>
parser() {
944 return DEFAULT_INSTANCE;