V
- the type of the value that we map to.public class DomainWildcardMappingBuilder<V>
extends java.lang.Object
Mapping
s that support
DNS wildcard matching.构造器和说明 |
---|
DomainWildcardMappingBuilder(int initialCapacity,
V defaultValue)
Constructor with initial capacity of the map holding the mappings
|
DomainWildcardMappingBuilder(V defaultValue)
Constructor with default initial capacity of the map holding the mappings
|
限定符和类型 | 方法和说明 |
---|---|
DomainWildcardMappingBuilder<V> |
add(java.lang.String hostname,
V output)
Adds a mapping that maps the specified (optionally wildcard) host name to the specified output value.
|
Mapping<java.lang.String,V> |
build()
Creates a new instance of an immutable
Mapping . |
public DomainWildcardMappingBuilder(V defaultValue)
defaultValue
- the default value for Mapping.map(Object)
)} to return
when nothing matches the inputpublic DomainWildcardMappingBuilder(int initialCapacity, V defaultValue)
initialCapacity
- initial capacity for the internal mapdefaultValue
- the default value for Mapping.map(Object)
to return
when nothing matches the inputpublic DomainWildcardMappingBuilder<V> add(java.lang.String hostname, V output)
null
values are forbidden for both hostnames and values.
DNS wildcard is supported as hostname. The wildcard will only match one sub-domain deep and only when wildcard is used as the most-left label. For example:
*.netty.io will match xyz.netty.io but NOT abc.xyz.netty.io
hostname
- the host name (optionally wildcard)output
- the output value that will be returned by Mapping.map(Object)
when the specified host name matches the specified input host name