Package io.netty.util

Class DomainNameMapping<V>

java.lang.Object
io.netty.util.DomainNameMapping<V>
All Implemented Interfaces:
Mapping<String,V>
Direct Known Subclasses:
DomainNameMappingBuilder.ImmutableDomainNameMapping

@Deprecated public class DomainNameMapping<V> extends Object implements Mapping<String,V>
Maps a domain name to its associated value object.

DNS wildcard is supported as hostname, so you can use *.netty.io to match both netty.io and downloads.netty.io.

  • Field Details

    • defaultValue

      final V defaultValue
      Deprecated.
    • map

      private final Map<String,V> map
      Deprecated.
    • unmodifiableMap

      private final Map<String,V> unmodifiableMap
      Deprecated.
  • Constructor Details

    • DomainNameMapping

      @Deprecated public DomainNameMapping(V defaultValue)
      Deprecated.
      use DomainNameMappingBuilder to create and fill the mapping instead
      Creates a default, order-sensitive mapping. If your hostnames are in conflict, the mapping will choose the one you add first.
      Parameters:
      defaultValue - the default value for map(String) to return when nothing matches the input
    • DomainNameMapping

      @Deprecated public DomainNameMapping(int initialCapacity, V defaultValue)
      Deprecated.
      use DomainNameMappingBuilder to create and fill the mapping instead
      Creates a default, order-sensitive mapping. If your hostnames are in conflict, the mapping will choose the one you add first.
      Parameters:
      initialCapacity - initial capacity for the internal map
      defaultValue - the default value for map(String) to return when nothing matches the input
    • DomainNameMapping

      DomainNameMapping(Map<String,V> map, V defaultValue)
      Deprecated.
  • Method Details

    • add

      @Deprecated public DomainNameMapping<V> add(String hostname, V output)
      Deprecated.
      use DomainNameMappingBuilder to create and fill the mapping instead
      Adds a mapping that maps the specified (optionally wildcard) host name to the specified output value.

      DNS wildcard is supported as hostname. For example, you can use *.netty.io to match netty.io and downloads.netty.io.

      Parameters:
      hostname - the host name (optionally wildcard)
      output - the output value that will be returned by map(String) when the specified host name matches the specified input host name
    • matches

      static boolean matches(String template, String hostName)
      Deprecated.
      Simple function to match DNS wildcard.
    • normalizeHostname

      static String normalizeHostname(String hostname)
      Deprecated.
      IDNA ASCII conversion and case normalization
    • needsNormalization

      private static boolean needsNormalization(String hostname)
      Deprecated.
    • map

      public V map(String hostname)
      Deprecated.
      Description copied from interface: Mapping
      Returns mapped value of the specified input.
      Specified by:
      map in interface Mapping<String,V>
    • asMap

      public Map<String,V> asMap()
      Deprecated.
      Returns a read-only Map of the domain mapping patterns and their associated value objects.
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object