Example usage for java.util.function ToLongFunction applyAsLong

List of usage examples for java.util.function ToLongFunction applyAsLong

Introduction

In this page you can find the example usage for java.util.function ToLongFunction applyAsLong.

Prototype

long applyAsLong(T value);

Source Link

Document

Applies this function to the given argument.

Usage

From source file:at.gridtec.lambda4j.function.bi.obj.ObjShortToLongFunction.java

/**
 * Creates a {@link ObjShortToLongFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link ToLongFunction}./* w  w w.  j  a  va 2  s  . c o  m*/
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code ObjShortToLongFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code ToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjShortToLongFunction<T> onlyFirst(@Nonnull final ToLongFunction<? super T> function) {
    Objects.requireNonNull(function);
    return (t, value) -> function.applyAsLong(t);
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjBooleanToLongFunction.java

/**
 * Creates a {@link ObjBooleanToLongFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link ToLongFunction}./* ww  w  .ja  v  a2s  . c  o m*/
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code ObjBooleanToLongFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code ToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBooleanToLongFunction<T> onlyFirst(@Nonnull final ToLongFunction<? super T> function) {
    Objects.requireNonNull(function);
    return (t, value) -> function.applyAsLong(t);
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjIntToLongFunction.java

/**
 * Creates a {@link ObjIntToLongFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link ToLongFunction}./*from   w ww . j a  v a 2  s . c  o  m*/
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code ObjIntToLongFunction} which uses the {@code first} parameter of this one as argument for
 * the given {@code ToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjIntToLongFunction<T> onlyFirst(@Nonnull final ToLongFunction<? super T> function) {
    Objects.requireNonNull(function);
    return (t, value) -> function.applyAsLong(t);
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToLongFunction.java

/**
 * Creates a {@link ObjDoubleToLongFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link ToLongFunction}./*  w  ww. j ava2s . c  o  m*/
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code ObjDoubleToLongFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code ToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjDoubleToLongFunction<T> onlyFirst(@Nonnull final ToLongFunction<? super T> function) {
    Objects.requireNonNull(function);
    return (t, value) -> function.applyAsLong(t);
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiLongToLongFunction.java

/**
 * Creates a {@link ObjBiLongToLongFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link ToLongFunction}.//  w ww  .  j  a  va  2s .com
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code ObjBiLongToLongFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code ToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBiLongToLongFunction<T> onlyFirst(@Nonnull final ToLongFunction<? super T> function) {
    Objects.requireNonNull(function);
    return (t, value1, value2) -> function.applyAsLong(t);
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiIntToLongFunction.java

/**
 * Creates a {@link ObjBiIntToLongFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link ToLongFunction}./*from  w w w  .  j  a  va  2s .c om*/
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code ObjBiIntToLongFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code ToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBiIntToLongFunction<T> onlyFirst(@Nonnull final ToLongFunction<? super T> function) {
    Objects.requireNonNull(function);
    return (t, value1, value2) -> function.applyAsLong(t);
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiByteToLongFunction.java

/**
 * Creates a {@link ObjBiByteToLongFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link ToLongFunction}.//w  ww .  j  a  v a  2 s  . c  o m
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code ObjBiByteToLongFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code ToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBiByteToLongFunction<T> onlyFirst(@Nonnull final ToLongFunction<? super T> function) {
    Objects.requireNonNull(function);
    return (t, value1, value2) -> function.applyAsLong(t);
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiCharToLongFunction.java

/**
 * Creates a {@link ObjBiCharToLongFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link ToLongFunction}./*from   www .  j  a  v  a 2s . c o  m*/
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code ObjBiCharToLongFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code ToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBiCharToLongFunction<T> onlyFirst(@Nonnull final ToLongFunction<? super T> function) {
    Objects.requireNonNull(function);
    return (t, value1, value2) -> function.applyAsLong(t);
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiFloatToLongFunction.java

/**
 * Creates a {@link ObjBiFloatToLongFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link ToLongFunction}./*  w w  w.  java2s  .c  om*/
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code ObjBiFloatToLongFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code ToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBiFloatToLongFunction<T> onlyFirst(@Nonnull final ToLongFunction<? super T> function) {
    Objects.requireNonNull(function);
    return (t, value1, value2) -> function.applyAsLong(t);
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiShortToLongFunction.java

/**
 * Creates a {@link ObjBiShortToLongFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link ToLongFunction}./*from w  w  w. j ava 2s . c  o m*/
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code ObjBiShortToLongFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code ToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBiShortToLongFunction<T> onlyFirst(@Nonnull final ToLongFunction<? super T> function) {
    Objects.requireNonNull(function);
    return (t, value1, value2) -> function.applyAsLong(t);
}