public static class InterpolatorSpecification.Builder extends Object
A builder class for creating instances of
InterpolatorSpecification
.
This class provides a fluent API for defining the various properties of
an InterpolatorSpecification
object. Note: This builder
class is not thread-safe.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
InterpolatorSpecification |
create()
Creates a new
InterpolatorSpecification instance with the
properties set so far. |
void |
reset()
Removes all data from this builder.
|
InterpolatorSpecification.Builder |
withDefaultLookup(Lookup lookup)
Adds the given
Lookup object to the list of default lookups. |
InterpolatorSpecification.Builder |
withDefaultLookups(Collection<? extends Lookup> lookups)
Adds the content of the given collection to the default lookups
managed by this builder.
|
InterpolatorSpecification.Builder |
withInterpolator(ConfigurationInterpolator ci)
Sets the
ConfigurationInterpolator instance for the
InterpolatorSpecification . |
InterpolatorSpecification.Builder |
withParentInterpolator(ConfigurationInterpolator parent)
Sets an optional parent
ConfigurationInterpolator . |
InterpolatorSpecification.Builder |
withPrefixLookup(String prefix,
Lookup lookup)
Adds a
Lookup object for a given prefix. |
InterpolatorSpecification.Builder |
withPrefixLookups(Map<String,? extends Lookup> lookups)
Adds the content of the given map to the prefix lookups managed by
this builder.
|
public InterpolatorSpecification.Builder withPrefixLookup(String prefix, Lookup lookup)
Lookup
object for a given prefix.prefix
- the prefix (must not be null)lookup
- the Lookup
(must not be null)IllegalArgumentException
- if a required parameter is missingpublic InterpolatorSpecification.Builder withPrefixLookups(Map<String,? extends Lookup> lookups)
lookups
- the map with prefix lookups to be addedIllegalArgumentException
- if the map contains null
valuespublic InterpolatorSpecification.Builder withDefaultLookup(Lookup lookup)
Lookup
object to the list of default lookups.lookup
- the Lookup
(must not be null)IllegalArgumentException
- if the Lookup
is nullpublic InterpolatorSpecification.Builder withDefaultLookups(Collection<? extends Lookup> lookups)
lookups
- the collection with lookups to be addedIllegalArgumentException
- if the collection contains
null entriespublic InterpolatorSpecification.Builder withInterpolator(ConfigurationInterpolator ci)
ConfigurationInterpolator
instance for the
InterpolatorSpecification
. This means that a
ConfigurationInterpolator
has been created and set up
externally and can be used directly.ci
- the ConfigurationInterpolator
(can be null)public InterpolatorSpecification.Builder withParentInterpolator(ConfigurationInterpolator parent)
ConfigurationInterpolator
. If
defined, this object is set as parent of a newly created
ConfigurationInterpolator
instance.parent
- the parent ConfigurationInterpolator
(can be
null)public InterpolatorSpecification create()
InterpolatorSpecification
instance with the
properties set so far. After that this builder instance is reset so
that it can be reused for creating further specification objects.InterpolatorSpecification
public void reset()
InterpolatorSpecification
object.Copyright © 2001–2020 The Apache Software Foundation. All rights reserved.