public class ConfigurationValueSourceComparingArbiter extends ComparatorBasedArbiter<ConfigurationValue>
ConfigurationValue
,
ComparatorBasedArbiter
Constructor and Description |
---|
ConfigurationValueSourceComparingArbiter()
Creates a new
ConfigurationValueSourceComparingArbiter . |
ConfigurationValueSourceComparingArbiter(List<? extends Configuration> configurationInstances)
Creates a new
ConfigurationValueSourceComparingArbiter . |
Modifier and Type | Method and Description |
---|---|
ConfigurationValue |
arbitrate(Map<? extends String,? extends String> requestedCoordinates,
String name,
Collection<? extends ConfigurationValue> ambiguousValues)
Resolves the configuration value ambiguity represented by the
supplied
ambiguousValues parameter value by selecting the
ConfigurationValue whose associated source is ranked closer to
0 . |
protected boolean |
canArbitrate(Collection<? extends ConfigurationValue> ambiguousValues)
Returns
true if this ConfigurationValueSourceComparingArbiter can effectively
arbitrate the conflict represented by the supplied Collection of ambiguous ConfigurationValue s. |
protected RankedComparator<ConfigurationValue> |
getComparator()
Returns the
RankedComparator used by this ConfigurationValueSourceComparingArbiter implementation. |
public ConfigurationValueSourceComparingArbiter()
ConfigurationValueSourceComparingArbiter
.public ConfigurationValueSourceComparingArbiter(List<? extends Configuration> configurationInstances)
ConfigurationValueSourceComparingArbiter
.configurationInstances
- a List
of Class
instances describing configuration value sources; may be (trivially)
null
RankedComparator.RankedComparator(List)
public ConfigurationValue arbitrate(Map<? extends String,? extends String> requestedCoordinates, String name, Collection<? extends ConfigurationValue> ambiguousValues)
ambiguousValues
parameter value by selecting the
ConfigurationValue
whose associated source is ranked closer to
0
.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
protected RankedComparator<ConfigurationValue> getComparator()
RankedComparator
used by this ConfigurationValueSourceComparingArbiter
implementation.
This method never returns null
.
Overrides of this method must never return null
.
getComparator
in class ComparatorBasedArbiter<ConfigurationValue>
null
RankedComparator
ComparatorBasedArbiter.ComparatorBasedArbiter(Comparator)
protected boolean canArbitrate(Collection<? extends ConfigurationValue> ambiguousValues)
true
if this ConfigurationValueSourceComparingArbiter
can effectively
arbitrate the conflict represented by the supplied Collection
of ambiguous ConfigurationValue
s.ambiguousValues
- a Collection
of ConfigurationValue
s; may be null
; must not be modified
by overrides of this methodtrue
if this ConfigurationValueSourceComparingArbiter
can effectively
arbitrate the conflict represented by the supplied Collection
of ambiguous ConfigurationValue
s; false
otherwiseCopyright © 2017–2019, microBean. All rights reserved.