本文整理匯總了Java中org.dmfs.jems.function.BiFunction類的典型用法代碼示例。如果您正苦於以下問題:Java BiFunction類的具體用法?Java BiFunction怎麽用?Java BiFunction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BiFunction類屬於org.dmfs.jems.function包,在下文中一共展示了BiFunction類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testPresent
import org.dmfs.jems.function.BiFunction; //導入依賴的package包/類
@Test
public void testPresent()
{
Object dummyPresentValue = new Object();
Object dummySingleValue = new Object();
Object dummyResult = new Object();
BiFunction<Object, Object, Object> mockFunction = failingMock(BiFunction.class);
doReturn(dummyResult).when(mockFunction).value(dummyPresentValue, dummySingleValue);
assertThat(new Zipped<>(new Present<>(dummyPresentValue), new ValueSingle<>(dummySingleValue), mockFunction), hasValue(sameInstance(dummyResult)));
}
示例2: Zipped
import org.dmfs.jems.function.BiFunction; //導入依賴的package包/類
public <V> Zipped(Optional<V> optionalValue, Single<T> delegate, BiFunction<V, T, T> function)
{
super(new Backed<T>(new Mapped<>(from -> function.value(from, delegate.value()), optionalValue), delegate));
}
示例3: testAbsent
import org.dmfs.jems.function.BiFunction; //導入依賴的package包/類
@Test
public void testAbsent()
{
Object dummyObject = new Object();
assertThat(new Zipped<>(absent(), new ValueSingle<>(dummyObject), dummy(BiFunction.class)), hasValue(sameInstance(dummyObject)));
}