Class GeneratorSpec.CosId80

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

public static final class GeneratorSpec.CosId80 extends Object implements GeneratorSpec
A time-based generator wider than a long (Layout.COSID_80 by default), issuing parts and text only. Its layout keeps the Unix epoch and milliseconds, so the text of every CosId implementation decodes alike (D36); CosIdRuntime.start rejects a layout of 63 bits or fewer (use GeneratorSpec.Snowflake).
  • Method Details

    • builder

      public static GeneratorSpec.CosId80.Builder builder()
      A builder of a cosid80 generator.
      Returns:
      the builder
    • layout

      public Layout layout()
      The layout: wider than 63 bits, with the Unix epoch and milliseconds, timeBits + seqBits at most 63; its node bits must cover the machine bits.
      Returns:
      the layout; default Layout.COSID_80
    • regression

      public ClockRegressionPolicy regression()
      The clock regression policy.
      Returns:
      the policy; default ClockRegressionPolicy.DEFAULT
    • codec

      public PartsCodecSpec codec()
      The parts codec.
      Returns:
      the codec; default radix 62
    • machine

      public Optional<String> machine()
      The machine whose slot the ids carry (D37).
      Returns:
      the machine name; empty (the default) or "default" for the RuntimeSpec.machine()
    • withMachine

      public GeneratorSpec.CosId80 withMachine(String machine)
      This generator on another machine, such as a slot in a namespace shared across services.
      Parameters:
      machine - the machine name
      Returns:
      the generator
    • 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