public interface Arbiter
ConfigurationValue
s.arbitrate(Map, String, Collection)
Modifier and Type | Method and Description |
---|---|
ConfigurationValue |
arbitrate(Map<? extends String,? extends String> requestedCoordinates,
String name,
Collection<? extends ConfigurationValue> ambiguousValues)
Given a logical request for a configuration value, represented by
the
callerCoordinates and name parameter values,
and a Collection of ConfigurationValue instances
that represents the ambiguous response from several Configuration instances, attempts to resolve the ambiguity by
returning a single ConfigurationValue instead. |
ConfigurationValue arbitrate(Map<? extends String,? extends String> requestedCoordinates, String name, Collection<? extends ConfigurationValue> ambiguousValues)
callerCoordinates
and name
parameter values,
and a Collection
of ConfigurationValue
instances
that represents the ambiguous response from several Configuration
instances, attempts to resolve the ambiguity by
returning a single ConfigurationValue
instead.
Implementations of this method may return null
.
A special case is when the supplied ambiguousValues
parameter is null
or empty. This means, effectively, that all consulted Configuration
instances returned null
from their Configuration.getValue(Map, String)
methods. An Arbiter
encountering this state of affairs and returning a single
non-null
ConfigurationValue
is effectively
synthesizing a default value.
requestedCoordinates
- the (immutable) configuration
coordinates in effect for the request; may be null
name
- the name of the configuration value; must not be
null
ambiguousValues
- an immutable Collection
of definitionally ambiguous ConfigurationValue
s that resulted from the request; may be
null
null
if the dispute
cannot be arbitrated by this Arbiter
NullPointerException
- if name
is null
AmbiguousConfigurationValuesException
- if overall
arbitration is to be cut short by this Arbiter
—normally an Arbiter
should simply return
null
Copyright © 2017–2019, microBean. All rights reserved.