Record Class CosIdProperties

java.lang.Object
java.lang.Record
me.ahoo.cosid.spring.autoconfigure.CosIdProperties
Record Components:
enabled - the master switch; default true
namespace - the namespace of the runtime; default spring.application.name, else cosid with a warning (D38)
stores - the stores by name, each declared once and referenced by name
machine - the default machine slot, needed by time-based generators that choose no other
machines - the named machine slots (D37), such as one in a namespace shared by several services
generators - the generators by name; default is the one injected without a qualifier
metrics - the Micrometer metrics

@ConfigurationProperties(prefix="cosid") public record CosIdProperties(boolean enabled, String namespace, Map<String,CosIdProperties.Store> stores, CosIdProperties.Machine machine, Map<String,CosIdProperties.NamedMachine> machines, Map<String,CosIdProperties.Generator> generators, CosIdProperties.Metrics metrics) extends Record
The cosid.* configuration (07-runtime-and-spring.md §4.1), bound once and immutable. CosIdSpecs.toSpec(me.ahoo.cosid.spring.autoconfigure.CosIdProperties, java.time.ZoneId) maps it to a RuntimeSpec; the runtime validates the rest.

This is the binding class: the compatibility promise covers the property keys, their defaults and their checks (api-freeze.md §0), not this Java type, which may change in any version. A cosid.* key that binds to nothing fails the start (R1-spring-03), but for cosid.stores.*.options and the keys of the integrations and the server.

  • Field Details

  • Constructor Details

  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • namespace

      public String namespace()
      Returns the value of the namespace record component.
      Returns:
      the value of the namespace record component
    • stores

      public Map<String,CosIdProperties.Store> stores()
      Returns the value of the stores record component.
      Returns:
      the value of the stores record component
    • machine

      public CosIdProperties.Machine machine()
      Returns the value of the machine record component.
      Returns:
      the value of the machine record component
    • machines

      Returns the value of the machines record component.
      Returns:
      the value of the machines record component
    • generators

      public Map<String,CosIdProperties.Generator> generators()
      Returns the value of the generators record component.
      Returns:
      the value of the generators record component
    • metrics

      public CosIdProperties.Metrics metrics()
      Returns the value of the metrics record component.
      Returns:
      the value of the metrics record component