Class GeneratorSpec.Custom

java.lang.Object
me.ahoo.cosid.runtime.GeneratorSpec.Custom
All Implemented Interfaces:
GeneratorSpec
Enclosing interface:
GeneratorSpec

public static final class GeneratorSpec.Custom extends Object implements GeneratorSpec
A user long generator by reference, for configuration: CosIdRuntime.start resolves the reference through RuntimeOptions.generators() and fails when it resolves to nothing.

The runtime does not own it (D41): it does not close, renew nor prefetch it, and it needs no store nor machine slot. It takes part in every lookup (generator(name), stringGenerator(name), get(name, type)), in IdFiller, in describe() (strategy custom, details class), in counting and in GeneratorSpec.Disabled.

  • Method Details

    • builder

      public static GeneratorSpec.Custom.Builder builder(String reference)
      A builder of a generator by reference.
      Parameters:
      reference - the name the runtime resolves through RuntimeOptions.generators(); in Spring a bean name
      Returns:
      the builder
    • reference

      public String reference()
      The name the runtime resolves through RuntimeOptions.generators(); in Spring a bean name.
      Returns:
      the reference
    • codec

      public List<CodecSpec> codec()
      The codec list of its text ids, applied in order; as for a GeneratorSpec.Segment, without a layout, so neither a CodecSpec.Friendly nor a CodecSpec.DatePrefix from the id time.
      Returns:
      the codec list; default empty, for none
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object