2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.restconf.restful.utils;
11 * Common util class for resolve enum from String.
13 * @deprecated move to splitted module restconf-nb-rfc8040
16 public final class ResolveEnumUtil {
18 private ResolveEnumUtil() {
19 throw new UnsupportedOperationException("Util class");
23 * Resolve specific type of enum by value.
31 public static <T> T resolveEnum(final Class<T> clazz, final String value) {
32 for (final T t : clazz.getEnumConstants()) {
33 if (((Enum<?>) t).name().equals(value)) {