MCPcopy Create free account
hub / github.com/grpc/grpc-java / buildStatusList

Method buildStatusList

api/src/main/java/io/grpc/Status.java:239–249  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

237 private static final List<Status> STATUS_LIST = buildStatusList();
238
239 private static List<Status> buildStatusList() {
240 TreeMap<Integer, Status> canonicalizer = new TreeMap<>();
241 for (Code code : Code.values()) {
242 Status replaced = canonicalizer.put(code.value(), new Status(code));
243 if (replaced != null) {
244 throw new IllegalStateException("Code value duplication between "
245 + replaced.getCode().name() + " & " + code.name());
246 }
247 }
248 return Collections.unmodifiableList(new ArrayList<>(canonicalizer.values()));
249 }
250
251 // A pseudo-enum of Status instances mapped 1:1 with values in Code. This simplifies construction
252 // patterns for derived instances of Status.

Callers 1

StatusClass · 0.95

Calls 5

getCodeMethod · 0.95
valuesMethod · 0.80
putMethod · 0.65
valueMethod · 0.65
nameMethod · 0.45

Tested by

no test coverage detected