Interface IntSupplier

All Superinterfaces:
IntSupplier, Supplier<Integer>, Supplier<Integer>
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 IntSupplier
extends Supplier<Integer>, IntSupplier
Represents a supplier of int-valued results. This is the int-producing primitive specialization of Supplier.

There is no requirement that a distinct result be returned each time the supplier is invoked.

This is a functional interface whose functional method is getAsInt().

Since:
1.8
See Also:
Supplier
  • Method Details

    • getAsInt

      int getAsInt()
      Gets a result.
      Specified by:
      getAsInt in interface IntSupplier
      Returns:
      a result
    • get

      default Integer get()
      Gets a result.
      Specified by:
      get in interface Supplier<Integer>
      Specified by:
      get in interface Supplier<Integer>
      Returns:
      a result
    • consume

      default Runnable consume​(IntConsumer consumer)
      Consume a supplier.
      Parameters:
      consumer - The consumer to use in consuming.
      Returns:
      A Runnable which passes the result of this supplier into the given consumer when run.
    • predicate

      default BooleanSupplier predicate​(IntPredicate functor)
      Lift a supplier.
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.
    • map

      default IntSupplier map​(IntUnaryOperator functor)
      Lift a supplier.
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.
    • mapToObj

      default <R> Supplier<R> mapToObj​(IntFunction<R> functor)
      Lift a supplier.
      Type Parameters:
      R - The new return type.
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A supplier that passes the result of fn through a functor to produce a lifted supplier.
    • mapToDouble

      default DoubleSupplier mapToDouble​(IntToDoubleFunction functor)
      Lift a supplier.
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.
    • mapToLong

      default LongSupplier mapToLong​(IntToLongFunction functor)
      Lift a supplier.
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.