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

org.infinispan.server.configuration.rest.Attribute Maven / Gradle / Ivy

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

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

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

   ALLOW_CREDENTIALS,
   COMPRESSION_LEVEL,
   COMPRESSION_THRESHOLD,
   CONTEXT_PATH,
   EXTENDED_HEADERS,
   HOST_NAME,
   MAX_AGE_SECONDS,
   MAX_CONTENT_LENGTH,
   MECHANISMS,
   NAME,
   REQUIRE_SSL_CLIENT_AUTH,
   SECURITY_REALM,
   SERVER_PRINCIPAL,
   SOCKET_BINDING,
   ALLOWED_HEADERS,
   ALLOWED_ORIGINS,
   ALLOWED_METHODS,
   EXPOSE_HEADERS;

   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;
   }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy