Interface GeneratorFunction<R>

  • Type Parameters:
    R - the type of the result of the function
    All Superinterfaces:
    java.io.Serializable
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface GeneratorFunction<R>
    extends java.io.Serializable
    A function which takes a timestamp and a sequence number as the input.
    Since:
    Jet 3.2
    • Method Detail

      • generate

        R generate​(long timestamp,
                   long sequence)
            throws java.lang.Exception
        Applies the function to the given timestamp and sequence.
        Parameters:
        timestamp - the current timestamp
        sequence - the current sequence
        Returns:
        the function result
        Throws:
        java.lang.Exception