Class AbstTimeBasedFactory.Builder<T,​B extends AbstTimeBasedFactory.Builder<T,​B>>

    • Field Detail

      • timeFunction

        protected TimeFunction timeFunction
        The time function.
      • nodeidFunction

        protected NodeIdFunction nodeidFunction
        The node function.
      • clockseqFunction

        protected ClockSeqFunction clockseqFunction
        The clock sequence function.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • getTimeFunction

        protected TimeFunction getTimeFunction()
        Get the time function.
        Returns:
        a function
      • getNodeIdFunction

        protected NodeIdFunction getNodeIdFunction()
        Get the node function.
        Returns:
        a function
      • getClockSeqFunction

        protected ClockSeqFunction getClockSeqFunction()
        Get the clock sequence function.
        Returns:
        a function
      • withTimeFunction

        public B withTimeFunction​(TimeFunction timeFunction)
        Set the time function.
        Parameters:
        timeFunction - a function
        Returns:
        the builder
      • withNodeIdFunction

        public B withNodeIdFunction​(NodeIdFunction nodeidFunction)
        Set the node function
        Parameters:
        nodeidFunction - a function
        Returns:
        the builder
      • withClockSeqFunction

        public B withClockSeqFunction​(ClockSeqFunction clockseqFunction)
        Set the clock sequence function
        Parameters:
        clockseqFunction - a function
        Returns:
        the builder
      • withInstant

        public B withInstant​(Instant instant)
        Set the fixed instant.
        Parameters:
        instant - an instant
        Returns:
        the builder
      • withClockSeq

        public B withClockSeq​(long clockseq)
        Set the fixed clock sequence.
        Parameters:
        clockseq - a clock sequence
        Returns:
        the builder
      • withClockSeq

        public B withClockSeq​(byte[] clockseq)
        Set a fixed clock sequence.
        Parameters:
        clockseq - a clock sequence
        Returns:
        the builder
      • withNodeId

        public B withNodeId​(long nodeid)
        Set a fixed node.
        Parameters:
        nodeid - a node
        Returns:
        the builder
      • withNodeId

        public B withNodeId​(byte[] nodeid)
        Set a fixed node
        Parameters:
        nodeid - a node
        Returns:
        the builder
      • withMacNodeId

        public B withMacNodeId()
        Set the node function to MAC strategy.
        Returns:
        the builder
      • withHashNodeId

        public B withHashNodeId()
        Set the node function to hash strategy.
        Returns:
        the builder
      • withRandomNodeId

        public B withRandomNodeId()
        Set the node function to random strategy.
        Returns:
        the builder
      • build

        public abstract T build()
        Finish the factory building.
        Returns:
        the built factory