Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
OptionalBoolean.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: ortools/util/optional_boolean.proto
3
4// Protobuf Java Version: 4.26.1
5package com.google.ortools.util;
6
21public enum OptionalBoolean
22 implements com.google.protobuf.ProtocolMessageEnum {
36 ;
37
38 static {
39 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
40 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
41 /* major= */ 4,
42 /* minor= */ 26,
43 /* patch= */ 1,
44 /* suffix= */ "",
45 OptionalBoolean.class.getName());
46 }
50 public static final int BOOL_UNSPECIFIED_VALUE = 0;
54 public static final int BOOL_FALSE_VALUE = 2;
58 public static final int BOOL_TRUE_VALUE = 3;
59
60
61 public final int getNumber() {
62 if (this == UNRECOGNIZED) {
63 throw new java.lang.IllegalArgumentException(
64 "Can't get the number of an unknown enum value.");
65 }
66 return value;
67 }
68
74 @java.lang.Deprecated
75 public static OptionalBoolean valueOf(int value) {
76 return forNumber(value);
77 }
78
83 public static OptionalBoolean forNumber(int value) {
84 switch (value) {
85 case 0: return BOOL_UNSPECIFIED;
86 case 2: return BOOL_FALSE;
87 case 3: return BOOL_TRUE;
88 default: return null;
89 }
90 }
91
92 public static com.google.protobuf.Internal.EnumLiteMap<OptionalBoolean>
94 return internalValueMap;
95 }
96 private static final com.google.protobuf.Internal.EnumLiteMap<
97 OptionalBoolean> internalValueMap =
98 new com.google.protobuf.Internal.EnumLiteMap<OptionalBoolean>() {
99 public OptionalBoolean findValueByNumber(int number) {
100 return OptionalBoolean.forNumber(number);
101 }
102 };
103
104 public final com.google.protobuf.Descriptors.EnumValueDescriptor
106 if (this == UNRECOGNIZED) {
107 throw new java.lang.IllegalStateException(
108 "Can't get the descriptor of an unrecognized enum value.");
109 }
110 return getDescriptor().getValues().get(ordinal());
111 }
112 public final com.google.protobuf.Descriptors.EnumDescriptor
114 return getDescriptor();
115 }
116 public static final com.google.protobuf.Descriptors.EnumDescriptor
118 return com.google.ortools.util.OptionalBooleanOuterClass.getDescriptor().getEnumTypes().get(0);
119 }
120
121 private static final OptionalBoolean[] VALUES = values();
122
124 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
125 if (desc.getType() != getDescriptor()) {
126 throw new java.lang.IllegalArgumentException(
127 "EnumValueDescriptor is not for this type.");
128 }
129 if (desc.getIndex() == -1) {
130 return UNRECOGNIZED;
131 }
132 return VALUES[desc.getIndex()];
133 }
134
135 private final int value;
136
137 private OptionalBoolean(int value) {
138 this.value = value;
139 }
140
141 // @@protoc_insertion_point(enum_scope:operations_research.OptionalBoolean)
142}
143
static OptionalBoolean valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
static com.google.protobuf.Internal.EnumLiteMap< OptionalBoolean > internalGetValueMap()
final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
static OptionalBoolean valueOf(int value)
static OptionalBoolean forNumber(int value)