Class Settings

java.lang.Object
java.util.AbstractMap<String,Object>
java.util.HashMap<String,Object>
org.refcodes.ontology.Taxonomy
org.refcodes.runtime.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

public class Settings extends org.refcodes.ontology.Taxonomy implements Diagnosable
The 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:
  • Constructor Details

    • Settings

      public Settings()
      Creates an empty Settings instance.

      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.Builder instance then is used to configure metadata values before creating the final MetaData instance via the protected Settings(Builder) constructor.

    • Settings

      protected Settings(Settings.Builder aBuilder)
      Instantiates a new instance from the given builder.
      Parameters:
      aBuilder - The builder from which to populate the this instance.
  • Method Details

    • ofNamespace

      public Settings ofNamespace(String aNamespace)
      Overrides:
      ofNamespace in class org.refcodes.ontology.Taxonomy
    • fromNamespace

      public Settings fromNamespace(String aNamespace)
      Overrides:
      fromNamespace in class org.refcodes.ontology.Taxonomy
    • removeNamespace

      public Settings removeNamespace(String aNamespace)
      Overrides:
      removeNamespace in class org.refcodes.ontology.Taxonomy
    • transformKeys

      public Settings transformKeys(Function<String,String> aMapper)
      Overrides:
      transformKeys in class org.refcodes.ontology.Taxonomy
    • transformValues

      public Settings transformValues(Function<Object,Object> aMapper)
      Overrides:
      transformValues in class org.refcodes.ontology.Taxonomy
    • merge

      public Settings merge(org.refcodes.ontology.Taxonomy aOther)
      Overrides:
      merge in class org.refcodes.ontology.Taxonomy
    • toSchema

      public Schema toSchema()
      Specified by:
      toSchema in interface Schemable<DiagnosticOptions>
    • toSchema

      public Schema toSchema(DiagnosticOptions aOptions)
      Specified by:
      toSchema in interface Schemable<DiagnosticOptions>
    • toSchema

      protected Schema toSchema(Settings.Node aNode, DiagnosticOptions aOptions)
    • builder

      public static Settings.Builder builder()
      Creates a new Settings.Builder for constructing Settings instances.
      Returns:
      A new builder instance
    • createResult

      protected Settings createResult()
      Overrides:
      createResult in class org.refcodes.ontology.Taxonomy
    • enrichSchema

      protected void enrichSchema(Schema.Builder aBuilder, Settings.Node aNode, DiagnosticOptions aOptions)
      Hook for subclasses to enrich a Schema node.

      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.