CpSolverStatus.java
Go to the documentation of this file.
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: ortools/sat/cp_model.proto
3 
4 package com.google.ortools.sat;
5 
13 public enum CpSolverStatus
14  implements com.google.protobuf.ProtocolMessageEnum {
23  UNKNOWN(0),
59  OPTIMAL(4),
61  ;
62 
71  public static final int UNKNOWN_VALUE = 0;
80  public static final int MODEL_INVALID_VALUE = 1;
89  public static final int FEASIBLE_VALUE = 2;
97  public static final int INFEASIBLE_VALUE = 3;
107  public static final int OPTIMAL_VALUE = 4;
108 
109 
110  public final int getNumber() {
111  if (this == UNRECOGNIZED) {
112  throw new java.lang.IllegalArgumentException(
113  "Can't get the number of an unknown enum value.");
114  }
115  return value;
116  }
117 
121  @java.lang.Deprecated
122  public static CpSolverStatus valueOf(int value) {
123  return forNumber(value);
124  }
125 
126  public static CpSolverStatus forNumber(int value) {
127  switch (value) {
128  case 0: return UNKNOWN;
129  case 1: return MODEL_INVALID;
130  case 2: return FEASIBLE;
131  case 3: return INFEASIBLE;
132  case 4: return OPTIMAL;
133  default: return null;
134  }
135  }
136 
137  public static com.google.protobuf.Internal.EnumLiteMap<CpSolverStatus>
139  return internalValueMap;
140  }
141  private static final com.google.protobuf.Internal.EnumLiteMap<
142  CpSolverStatus> internalValueMap =
143  new com.google.protobuf.Internal.EnumLiteMap<CpSolverStatus>() {
144  public CpSolverStatus findValueByNumber(int number) {
145  return CpSolverStatus.forNumber(number);
146  }
147  };
148 
149  public final com.google.protobuf.Descriptors.EnumValueDescriptor
151  return getDescriptor().getValues().get(ordinal());
152  }
153  public final com.google.protobuf.Descriptors.EnumDescriptor
155  return getDescriptor();
156  }
157  public static final com.google.protobuf.Descriptors.EnumDescriptor
159  return com.google.ortools.sat.CpModelProtobuf.getDescriptor().getEnumTypes().get(0);
160  }
161 
162  private static final CpSolverStatus[] VALUES = values();
163 
164  public static CpSolverStatus valueOf(
165  com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
166  if (desc.getType() != getDescriptor()) {
167  throw new java.lang.IllegalArgumentException(
168  "EnumValueDescriptor is not for this type.");
169  }
170  if (desc.getIndex() == -1) {
171  return UNRECOGNIZED;
172  }
173  return VALUES[desc.getIndex()];
174  }
175 
176  private final int value;
177 
178  private CpSolverStatus(int value) {
179  this.value = value;
180  }
181 
182  // @@protoc_insertion_point(enum_scope:operations_research.sat.CpSolverStatus)
183 }
184 
final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
.lang.Deprecated static CpSolverStatus valueOf(int value)
final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
static CpSolverStatus forNumber(int value)
static com.google.protobuf.Internal.EnumLiteMap< CpSolverStatus > internalGetValueMap()
static CpSolverStatus valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
static com.google.protobuf.Descriptors.FileDescriptor getDescriptor()
static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()