Class AvailableIdHolder

  • All Implemented Interfaces:
    IdHolder

    public class AvailableIdHolder
    extends java.lang.Object
    implements IdHolder
    • Constructor Detail

      • AvailableIdHolder

        public AvailableIdHolder​(IdUtils idUtils,
                                 long low,
                                 long high)
    • Method Detail

      • allocateId

        public com.google.common.base.Optional<java.lang.Long> allocateId()
        Specified by:
        allocateId in interface IdHolder
      • addId

        public void addId​(long id)
        Specified by:
        addId in interface IdHolder
      • isIdAvailable

        public boolean isIdAvailable​(long curTimeSec)
        Specified by:
        isIdAvailable in interface IdHolder
      • getLow

        public long getLow()
      • getHigh

        public long getHigh()
      • getCur

        public java.util.concurrent.atomic.AtomicLong getCur()
      • setCur

        public void setCur​(long cur)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object