public abstract static class BasicConfigInheritance.DelegatingConfigInheritance extends java.lang.Object implements ConfigInheritance
ConfigInheritance
which have no internal fields (ie they don't extend BasicConfigInheritance
)
so are pretty on serialization, but otherwise act identically.ConfigInheritance.ConfigInheritanceContext, ConfigInheritance.InheritanceMode, ConfigInheritance.Legacy
ALWAYS, DEEP_MERGE, NONE
Constructor and Description |
---|
DelegatingConfigInheritance() |
Modifier and Type | Method and Description |
---|---|
<TContainer,TValue> |
considerParent(ConfigValueAtContainer<TContainer,TValue> local,
ConfigValueAtContainer<TContainer,TValue> parent,
ConfigInheritance.ConfigInheritanceContext context)
Returns whether any value from the parent or its ancestors should be considered
by the given local container, according to the
ConfigInheritance defined there. |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
ConfigInheritance.InheritanceMode |
isInherited(ConfigKey<?> key,
java.lang.Object from,
java.lang.Object to)
Deprecated.
|
<TContainer,TValue> |
isReinheritable(ConfigValueAtContainer<TContainer,TValue> parent,
ConfigInheritance.ConfigInheritanceContext context)
Returns whether any value from the given node or ancestors can be considered
for inheritance by descendants, according to the
ConfigInheritance defined there. |
<TContainer,TValue> |
resolveWithParent(ConfigValueAtContainer<TContainer,TValue> local,
ConfigValueAtContainer<TContainer,TValue> resolvedParent,
ConfigInheritance.ConfigInheritanceContext context)
Returns the result after inheritance between the local container and a "resolveParent"
representation of the parent's evaluation of the key considering its ancestors.
|
@Deprecated public ConfigInheritance.InheritanceMode isInherited(ConfigKey<?> key, java.lang.Object from, java.lang.Object to)
isInherited
in interface ConfigInheritance
public <TContainer,TValue> boolean isReinheritable(ConfigValueAtContainer<TContainer,TValue> parent, ConfigInheritance.ConfigInheritanceContext context)
ConfigInheritance
ConfigInheritance
defined there.
The implementation of this method is usually a constant depending on the inheritance in effect;
in particular it will not normally consider any values or inform whether something should be inherited:
it is only advising whether inheritance is permitted from a given point in the inheritance hierarchy.
If there is a ConfigInheritance
defined at this node,
this method must be called on that instance and that instance only.
In that case it is an error to invoke this method on any other ConfigInheritance
instance.
If there is not one, the config generally should be considered reinheritable.
Key inference (continuing from the above): Callers should not try to infer any descendant key and look at what it says about reinheritability; if a container does not define a key it would be pointless for it not to be reinheritable).
Consumers will typically find the methods in ConfigInheritances
more convenient.
isReinheritable
in interface ConfigInheritance
public <TContainer,TValue> boolean considerParent(ConfigValueAtContainer<TContainer,TValue> local, ConfigValueAtContainer<TContainer,TValue> parent, ConfigInheritance.ConfigInheritanceContext context)
ConfigInheritance
ConfigInheritance
defined there.
This defines the ConfigInheritance
of the local container typically considering
the value of the key there.
Implementations should not normally consider the value of the parent
as there may be other ancestors whose values have not yet been considered and are not supplied,
but it may determine that a local value is sufficient to render it unnecessary to consider the parent.
If there is a ConfigInheritance
defined at the local container,
this method must be called on that instance and that instance only.
In that case it is an error to invoke this method on any other ConfigInheritance
instance.
Key inference: if a container does not define a key, the inheritance in the key definition in the nearest descendant of that container should be used.
Consumers should consider this in conjuction with the
ConfigInheritance.isReinheritable(ConfigValueAtContainer, ConfigInheritanceContext)
status of the parent (if present).
Implementers need not duplicate a call to that method.
Consumers will typically find the methods in ConfigInheritances
more convenient.
considerParent
in interface ConfigInheritance
public <TContainer,TValue> ReferenceWithError<ConfigValueAtContainer<TContainer,TValue>> resolveWithParent(ConfigValueAtContainer<TContainer,TValue> local, ConfigValueAtContainer<TContainer,TValue> resolvedParent, ConfigInheritance.ConfigInheritanceContext context)
ConfigInheritance
ConfigInheritance.considerParent(ConfigValueAtContainer, ConfigValueAtContainer, ConfigInheritanceContext)
on the local node and ConfigInheritance.isReinheritable(ConfigValueAtContainer, ConfigInheritanceContext)
on the original parent node,
and then ConfigInheritance.resolveWithParent(ConfigValueAtContainer, ConfigValueAtContainer, ConfigInheritanceContext)
on the original parent node with its respective resolvedParent.
If there is a ConfigInheritance
defined at the local container,
this method must be called on that instance and that instance only.
In that case it is an error to invoke this method on any other ConfigInheritance
instance.
Key inference: if a container does not define a key, the inheritance in the key definition in the nearest descendant of that container should be used.
Consumers will typically find the methods in ConfigInheritances
more convenient.
resolveWithParent
in interface ConfigInheritance
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object