Top Description Fields Constructors Methods
io.netty.util

public Class DomainNameMapping<V>

extends Object
implements Mapping<String, V>
Class Inheritance
All Implemented Interfaces
io.netty.util.Mapping
Known Direct Subclasses
io.netty.util.DomainNameMappingBuilder.ImmutableDomainNameMapping
Annotations
@Deprecated
Imports
io.netty.util.internal.StringUtil, java.net.IDN, java.util.Collections, .LinkedHashMap, .Locale, .Map

Deprecated

Use DomainWildcardMappingBuilder}

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 Summary

Modifier and TypeField and Description
pack-priv final V
private final Map<String, V>
private final Map<String, V>

Constructor Summary

AccessConstructor and Description
public
DomainNameMapping(V
the default value for map(String) to return when nothing matches the input
defaultValue
)

Deprecated use DomainNameMappingBuilder to create and fill the mapping instead
Creates a default, order-sensitive mapping.
public
DomainNameMapping(int
initial capacity for the internal map
initialCapacity
,
V
the default value for map(String) to return when nothing matches the input
defaultValue
)

Deprecated use DomainNameMappingBuilder to create and fill the mapping instead
Creates a default, order-sensitive mapping.
pack-priv
DomainNameMapping(Map<String, V> map, V defaultValue)

Method Summary

Modifier and TypeMethod and Description
public DomainNameMapping<V>
add(String
the host name (optionally wildcard)
hostname
,
V
the output value that will be returned by map(String) when the specified host name matches the specified input host name
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.
public Map<String, V>
asMap()

Returns a read-only Map of the domain mapping patterns and their associated value objects.

public V
map(String hostname)

Implements io.netty.util.Mapping.map.

Returns mapped value of the specified input.
pack-priv static boolean
matches(String template, String hostName)

Simple function to match DNS wildcard.

private static boolean
pack-priv static String
normalizeHostname(String hostname)

IDNA ASCII conversion and case normalization

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

defaultValueback to summary
pack-priv final V defaultValue
mapback to summary
private final Map<String, V> map
unmodifiableMapback to summary
private final Map<String, V> unmodifiableMap

Constructor Detail

DomainNameMappingback to summary
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:V

the default value for map(String) to return when nothing matches the input

Annotations
@Deprecated
DomainNameMappingback to summary
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:int

initial capacity for the internal map

defaultValue:V

the default value for map(String) to return when nothing matches the input

Annotations
@Deprecated
DomainNameMappingback to summary
pack-priv DomainNameMapping(Map<String, V> map, V defaultValue)

Method Detail

addback to summary
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:String

the host name (optionally wildcard)

output:V

the output value that will be returned by map(String) when the specified host name matches the specified input host name

Annotations
@Deprecated
asMapback to summary
public Map<String, V> asMap()

Returns a read-only Map of the domain mapping patterns and their associated value objects.

mapback to summary
public V map(String hostname)

Implements io.netty.util.Mapping.map.

Doc from io.netty.util.Mapping.map.

Returns mapped value of the specified input.

Annotations
@Override
matchesback to summary
pack-priv static boolean matches(String template, String hostName)

Simple function to match DNS wildcard.

needsNormalizationback to summary
private static boolean needsNormalization(String hostname)
normalizeHostnameback to summary
pack-priv static String normalizeHostname(String hostname)

IDNA ASCII conversion and case normalization

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override