本文整理汇总了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)));
}