All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.server.configuration.memcached.Element Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev05
Show newest version
package org.infinispan.server.configuration.memcached;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Tristan Tarrant
 * @since 10.0
 */
public enum Element {
   //must be first
   UNKNOWN(null),

   MEMCACHED_CONNECTOR,
   AUTHENTICATION,
   ENCRYPTION,
   SASL;

   private static final Map ELEMENTS;

   static {
      final Map map = new HashMap<>(8);
      for (Element element : values()) {
         final String name = element.name;
         if (name != null) {
            map.put(name, element);
         }
      }
      ELEMENTS = map;
   }

   private final String name;

   Element(final String name) {
      this.name = name;
   }

   Element() {
      this.name = name().toLowerCase().replace('_', '-');
   }

   public static Element forName(final String localName) {
      final Element element = ELEMENTS.get(localName);
      return element == null ? UNKNOWN : element;
   }

   @Override
   public String toString() {
      return name;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy