Class SequentialdISupplier

  • All Implemented Interfaces:
    java.util.function.Supplier<java.lang.String>

    public class SequentialdISupplier
    extends java.lang.Object
    implements java.util.function.Supplier<java.lang.String>
    Supplies sequential string identifiers via get(), each guaranteed to be sequentially unique. The identifiers begin with some prefix and end with a sequential number.

    This implementation makes no allowance for sequential values past the maximum unsigned value stored in a long.

    This class is thread safe.

    Author:
    Garret Wilson
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String get()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SequentialdISupplier

        public SequentialdISupplier()
        Constructor with no prefix.
      • SequentialdISupplier

        public SequentialdISupplier​(@Nonnull
                                    java.lang.String prefix)
        Prefix constructor.
        Parameters:
        prefix - The prefix to use in the generated identifiers.
    • Method Detail

      • get

        public java.lang.String get()
        Specified by:
        get in interface java.util.function.Supplier<java.lang.String>