Package io.netty.util
Class DomainNameMapping<V>
- java.lang.Object
-
- io.netty.util.DomainNameMapping<V>
-
- All Implemented Interfaces:
Mapping<java.lang.String,V>
- Direct Known Subclasses:
DomainNameMappingBuilder.ImmutableDomainNameMapping
@Deprecated public class DomainNameMapping<V> extends java.lang.Object implements Mapping<java.lang.String,V>
Deprecated.Maps a domain name to its associated value object.DNS wildcard is supported as hostname, so you can use
*.netty.ioto match bothnetty.ioanddownloads.netty.io.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) VdefaultValueDeprecated.private java.util.Map<java.lang.String,V>mapDeprecated.private java.util.Map<java.lang.String,V>unmodifiableMapDeprecated.
-
Constructor Summary
Constructors Constructor Description DomainNameMapping(int initialCapacity, V defaultValue)Deprecated.useDomainNameMappingBuilderto create and fill the mapping insteadDomainNameMapping(java.util.Map<java.lang.String,V> map, V defaultValue)Deprecated.DomainNameMapping(V defaultValue)Deprecated.useDomainNameMappingBuilderto create and fill the mapping instead
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DomainNameMapping<V>add(java.lang.String hostname, V output)Deprecated.useDomainNameMappingBuilderto create and fill the mapping insteadjava.util.Map<java.lang.String,V>asMap()Deprecated.Returns a read-onlyMapof the domain mapping patterns and their associated value objects.Vmap(java.lang.String hostname)Deprecated.Returns mapped value of the specified input.(package private) static booleanmatches(java.lang.String template, java.lang.String hostName)Deprecated.Simple function to match DNS wildcard.private static booleanneedsNormalization(java.lang.String hostname)Deprecated.(package private) static java.lang.StringnormalizeHostname(java.lang.String hostname)Deprecated.IDNA ASCII conversion and case normalizationjava.lang.StringtoString()Deprecated.
-
-
-
Constructor Detail
-
DomainNameMapping
@Deprecated public DomainNameMapping(V defaultValue)
Deprecated.useDomainNameMappingBuilderto create and fill the mapping insteadCreates 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 formap(String)to return when nothing matches the input
-
DomainNameMapping
@Deprecated public DomainNameMapping(int initialCapacity, V defaultValue)Deprecated.useDomainNameMappingBuilderto create and fill the mapping insteadCreates 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 mapdefaultValue- the default value formap(String)to return when nothing matches the input
-
-
Method Detail
-
add
@Deprecated public DomainNameMapping<V> add(java.lang.String hostname, V output)
Deprecated.useDomainNameMappingBuilderto create and fill the mapping insteadAdds 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.ioto matchnetty.ioanddownloads.netty.io.- Parameters:
hostname- the host name (optionally wildcard)output- the output value that will be returned bymap(String)when the specified host name matches the specified input host name
-
matches
static boolean matches(java.lang.String template, java.lang.String hostName)Deprecated.Simple function to match DNS wildcard.
-
normalizeHostname
static java.lang.String normalizeHostname(java.lang.String hostname)
Deprecated.IDNA ASCII conversion and case normalization
-
needsNormalization
private static boolean needsNormalization(java.lang.String hostname)
Deprecated.
-
map
public V map(java.lang.String hostname)
Deprecated.Description copied from interface:MappingReturns mapped value of the specified input.
-
asMap
public java.util.Map<java.lang.String,V> asMap()
Deprecated.Returns a read-onlyMapof the domain mapping patterns and their associated value objects.
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
-