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

org.infinispan.lock.configuration.Attribute Maven / Gradle / Ivy

There is a newer version: 15.1.1.Final
Show newest version
package org.infinispan.lock.configuration;

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

/**
 * @author Katia Aresti, [email protected]
 * @since 9.4
 */
public enum Attribute {
   // must be first
   UNKNOWN(null),
   NAME("name"),
   NUM_OWNERS("num-owners"),
   RELIABILITY("reliability");

   private static final Map ATTRIBUTES;

   static {
      final Map map = new HashMap<>(64);
      for (Attribute attribute : values()) {
         final String name = attribute.name;
         if (name != null) {
            map.put(name, attribute);
         }
      }
      ATTRIBUTES = map;
   }

   private final String name;

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

   public static Attribute forName(String localName) {
      final Attribute attribute = ATTRIBUTES.get(localName);
      return attribute == null ? UNKNOWN : attribute;
   }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy