V
- concrete type of value objectspublic final class DomainNameMappingBuilder<V>
extends java.lang.Object
DomainNameMapping
instances.构造器和说明 |
---|
DomainNameMappingBuilder(int initialCapacity,
V defaultValue)
Constructor with initial capacity of the map holding the mappings
|
DomainNameMappingBuilder(V defaultValue)
Constructor with default initial capacity of the map holding the mappings
|
限定符和类型 | 方法和说明 |
---|---|
DomainNameMappingBuilder<V> |
add(java.lang.String hostname,
V output)
Adds a mapping that maps the specified (optionally wildcard) host name to the specified output value.
|
DomainNameMapping<V> |
build()
Creates a new instance of immutable
DomainNameMapping
Attempts to add new mappings to the result object will cause UnsupportedOperationException to be thrown |
public DomainNameMappingBuilder(V defaultValue)
defaultValue
- the default value for DomainNameMapping.map(String)
to return
when nothing matches the inputpublic DomainNameMappingBuilder(int initialCapacity, V defaultValue)
initialCapacity
- initial capacity for the internal mapdefaultValue
- the default value for DomainNameMapping.map(String)
to return
when nothing matches the inputpublic DomainNameMappingBuilder<V> add(java.lang.String hostname, V output)
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 DomainNameMapping.map(String)
when the specified host name matches the specified input host namepublic DomainNameMapping<V> build()
DomainNameMapping
Attempts to add new mappings to the result object will cause UnsupportedOperationException
to be thrownDomainNameMapping
instance