Class SupplierUtil


  • public class SupplierUtil
    extends Object
    Helper class for suppliers.
    Author:
    Dimitrios Michail
    • Constructor Detail

      • SupplierUtil

        public SupplierUtil()
    • Method Detail

      • createSupplier

        public static <T> Supplier<T> createSupplier​(Class<? extends T> clazz)
        Create a supplier from a class which calls the default constructor.
        Type Parameters:
        T - the type of results supplied by this supplier
        Parameters:
        clazz - the class
        Returns:
        the supplier
      • createDefaultEdgeSupplier

        public static Supplier<DefaultEdge> createDefaultEdgeSupplier()
        Create a default edge supplier.
        Returns:
        a default edge supplier
      • createDefaultWeightedEdgeSupplier

        public static Supplier<DefaultWeightedEdge> createDefaultWeightedEdgeSupplier()
        Create a default weighted edge supplier.
        Returns:
        a default weighted edge supplier
      • createIntegerSupplier

        public static Supplier<Integer> createIntegerSupplier()
        Create an integer supplier which returns a sequence starting from zero.
        Returns:
        an integer supplier
      • createIntegerSupplier

        public static Supplier<Integer> createIntegerSupplier​(int start)
        Create an integer supplier which returns a sequence starting from a specific numbers.
        Parameters:
        start - where to start the sequence
        Returns:
        an integer supplier
      • createLongSupplier

        public static Supplier<Long> createLongSupplier()
        Create a long supplier which returns a sequence starting from zero.
        Returns:
        a long supplier
      • createLongSupplier

        public static Supplier<Long> createLongSupplier​(long start)
        Create a long supplier which returns a sequence starting from a specific numbers.
        Parameters:
        start - where to start the sequence
        Returns:
        a long supplier
      • createStringSupplier

        public static Supplier<String> createStringSupplier()
        Create a string supplier which returns unique strings. The returns strings are simply integers starting from zero.
        Returns:
        a string supplier
      • createRandomUUIDStringSupplier

        public static Supplier<String> createRandomUUIDStringSupplier()
        Create a string supplier which returns random UUIDs.
        Returns:
        a string supplier
      • createStringSupplier

        public static Supplier<String> createStringSupplier​(int start)
        Create a string supplier which returns unique strings. The returns strings are simply integers starting from start.
        Parameters:
        start - where to start the sequence
        Returns:
        a string supplier