public class DomainNameMapping<V> extends java.lang.Object implements Mapping<java.lang.String,V>
DNS wildcard is supported as hostname, so you can use *.netty.io
to match both netty.io
and downloads.netty.io
.
Constructor and Description |
---|
DomainNameMapping(int initialCapacity,
V defaultValue)
Deprecated.
use
DomainNameMappingBuilder to create and fill the mapping instead |
DomainNameMapping(V defaultValue)
Deprecated.
use
DomainNameMappingBuilder to create and fill the mapping instead |
Modifier and Type | Method and Description |
---|---|
DomainNameMapping<V> |
add(java.lang.String hostname,
V output)
Deprecated.
use
DomainNameMappingBuilder to create and fill the mapping instead |
java.util.Map<java.lang.String,V> |
asMap()
Returns a read-only
Map of the domain mapping patterns and their associated value objects. |
V |
map(java.lang.String hostname)
Returns mapped value of the specified input.
|
java.lang.String |
toString() |
@Deprecated public DomainNameMapping(V defaultValue)
DomainNameMappingBuilder
to create and fill the mapping insteaddefaultValue
- the default value for map(String)
to return when nothing matches the input@Deprecated public DomainNameMapping(int initialCapacity, V defaultValue)
DomainNameMappingBuilder
to create and fill the mapping insteadinitialCapacity
- initial capacity for the internal mapdefaultValue
- the default value for map(String)
to return when nothing matches the input@Deprecated public DomainNameMapping<V> add(java.lang.String hostname, V output)
DomainNameMappingBuilder
to create and fill the mapping instead
DNS wildcard is supported as hostname.
For example, you can use *.netty.io
to match netty.io
and downloads.netty.io
.
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 namepublic V map(java.lang.String hostname)
Mapping
public java.util.Map<java.lang.String,V> asMap()
Map
of the domain mapping patterns and their associated value objects.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2008–2018 The Netty Project. All rights reserved.