Class Settings
- All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, Clearable, EmptyAccessor, org.refcodes.ontology.Ontology, Diagnosable, Schemable<DiagnosticOptions>, Containable, ImmutableTable<String, Object>, ImmutableTable.MutableTable<String, Object>, Keys<String, Object>, Keys.MutableKeys<String, Object>, Keys.MutableValues<String, Object>
- Direct Known Subclasses:
Options
Settings type serves as a flexible, namespace-aware container for
providing arbitrary metadata and dynamic configuration properties.
Settings are commonly used as the foundation for specialized types
such as MetaData, which add domain-specific semantics on top of a generic
key-value model.
In combination with Taxon and UnsafeTaxon, this type enforces
normalized, namespace-compatible identifiers, enabling structured keys such
as provider.origin or content.type.
Settings are particularly suited for scenarios where properties are
not known at compile time but emerge dynamically at runtime, for example:
- metadata discovered during filesystem scanning
- plugin-provided attributes
- externally supplied configuration or descriptors
While Settings behave similarly to a Map, they
provide additional semantics such as namespace handling, normalization and
hierarchical introspection via Schema.
This type is intentionally generic and not bound to a specific runtime concern. However, it resides in the runtime module as it represents a dynamic, runtime-populated data structure that can carry information whose shape and semantics are only fully known during execution.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for creatingSettingsinstances.protected static classprotected static classprotected static classNested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> Nested classes/interfaces inherited from interface EmptyAccessor
EmptyAccessor.EmptyBuilder<B>, EmptyAccessor.EmptyMutator, EmptyAccessor.EmptyPropertyNested classes/interfaces inherited from interface ImmutableTable
ImmutableTable.MutableTable<K,V> Nested classes/interfaces inherited from interface Keys
Keys.MutableKeys<K,V>, Keys.MutableValues<K, V> -
Field Summary
Fields inherited from class org.refcodes.ontology.Taxonomy
NAMESPACE_SEPARATOR -
Constructor Summary
ConstructorsModifierConstructorDescriptionSettings()Creates an emptySettingsinstance.protectedSettings(Settings.Builder aBuilder) Instantiates a new instance from the given builder. -
Method Summary
Modifier and TypeMethodDescriptionstatic Settings.Builderbuilder()Creates a newSettings.Builderfor constructingSettingsinstances.protected Settingsprotected voidenrichSchema(Schema.Builder aBuilder, Settings.Node aNode, DiagnosticOptions aOptions) Hook for subclasses to enrich aSchemanode.fromNamespace(String aNamespace) merge(org.refcodes.ontology.Taxonomy aOther) ofNamespace(String aNamespace) removeNamespace(String aNamespace) toSchema()toSchema(DiagnosticOptions aOptions) protected SchematoSchema(Settings.Node aNode, DiagnosticOptions aOptions) transformKeys(Function<String, String> aMapper) transformValues(Function<Object, Object> aMapper) Methods inherited from class org.refcodes.ontology.Taxonomy
contains, containsNamespace, get, get, get, get, getOr, namespaces, put, put, remove, toKey, toNormalizedMethods inherited from class HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface Containable
sizeMethods inherited from interface EmptyAccessor
isEmptyMethods inherited from interface ImmutableTable.MutableTable
delete, putMethods inherited from interface Keys
containsKey, containsValue, get, getOr, keySet, valuesMethods inherited from interface Keys.MutableValues
putMethods inherited from interface Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from interface org.refcodes.ontology.Ontology
get, get, getOr, getOr, getOr
-
Constructor Details
-
Settings
public Settings()Creates an emptySettingsinstance.Note: This constructor is intended for quick experimentation or ad-hoc usage. Use the static
builder()factory method for more sophisticated type-safe construction!The
Settings.Builderinstance then is used to configure metadata values before creating the finalMetaDatainstance via the protectedSettings(Builder)constructor. -
Settings
Instantiates a new instance from the given builder.- Parameters:
aBuilder- The builder from which to populate the this instance.
-
-
Method Details
-
ofNamespace
-
fromNamespace
-
removeNamespace
-
transformKeys
-
transformValues
-
merge
- Overrides:
mergein classorg.refcodes.ontology.Taxonomy
-
toSchema
- Specified by:
toSchemain interfaceSchemable<DiagnosticOptions>
-
toSchema
- Specified by:
toSchemain interfaceSchemable<DiagnosticOptions>
-
toSchema
-
builder
Creates a newSettings.Builderfor constructingSettingsinstances.- Returns:
- A new builder instance
-
createResult
- Overrides:
createResultin classorg.refcodes.ontology.Taxonomy
-
enrichSchema
protected void enrichSchema(Schema.Builder aBuilder, Settings.Node aNode, DiagnosticOptions aOptions) Hook for subclasses to enrich aSchemanode.This method is invoked for each node during schema construction and allows subclasses to attach additional metadata such as diagnostic or runtime information.
The default implementation does nothing.
- Parameters:
aBuilder- The schema builder representing the current node.aNode- The internal node representation.aOptions- Optional diagnostic options.
-