本文整理汇总了Java中org.ethereum.util.Functional.Consumer方法的典型用法代码示例。如果您正苦于以下问题:Java Functional.Consumer方法的具体用法?Java Functional.Consumer怎么用?Java Functional.Consumer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ethereum.util.Functional
的用法示例。
在下文中一共展示了Functional.Consumer方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createIn1
import org.ethereum.util.Functional; //导入方法依赖的package包/类
Functional.Consumer<BzzMessage> createIn1() {
return new Functional.Consumer<BzzMessage>() {
@Override
public void accept(BzzMessage bzzMessage) {
BzzMessage smsg = serialize(bzzMessage);
if (TestPeer.MessageOut) {
stdout.println("+ " + name1 + " => " + name2 + ": " + smsg);
}
out2.accept(smsg);
}
};
}
示例2: createIn2
import org.ethereum.util.Functional; //导入方法依赖的package包/类
Functional.Consumer<BzzMessage> createIn2() {
return new Functional.Consumer<BzzMessage>() {
@Override
public void accept(BzzMessage bzzMessage) {
BzzMessage smsg = serialize(bzzMessage);
if (TestPeer.MessageOut) {
stdout.println("+ " + name2 + " => " + name1 + ": " + smsg);
}
out1.accept(smsg);
}
};
}
示例3: setMessageSender
import org.ethereum.util.Functional; //导入方法依赖的package包/类
public void setMessageSender(Functional.Consumer<DiscoveryEvent> messageSender) {
this.messageSender = messageSender;
}
示例4: TestPipe
import org.ethereum.util.Functional; //导入方法依赖的package包/类
public TestPipe(Functional.Consumer<BzzMessage> out1, Functional.Consumer<BzzMessage> out2) {
this.out1 = out1;
this.out2 = out2;
}
示例5: getOut1
import org.ethereum.util.Functional; //导入方法依赖的package包/类
public Functional.Consumer<BzzMessage> getOut1() {
return out1;
}
示例6: getOut2
import org.ethereum.util.Functional; //导入方法依赖的package包/类
public Functional.Consumer<BzzMessage> getOut2() {
return out2;
}
示例7: AsyncConsumer
import org.ethereum.util.Functional; //导入方法依赖的package包/类
public AsyncConsumer(Functional.Consumer<BzzMessage> delegate, boolean rev) {
this.delegate = delegate;
this.rev = rev;
}
示例8: TestAsyncPipe
import org.ethereum.util.Functional; //导入方法依赖的package包/类
public TestAsyncPipe(Functional.Consumer<BzzMessage> out1, Functional.Consumer<BzzMessage> out2) {
this.out1 = new AsyncConsumer(out1, false);
this.out2 = new AsyncConsumer(out2, true);
}
示例9: setMessageSender
import org.ethereum.util.Functional; //导入方法依赖的package包/类
/**
* Installs the message sender.
* Normally this is BzzHandler which just sends the message to the peer over the wire
* In the testing environment this could be a special handler which delivers the message
* without network stack
*/
public void setMessageSender(Functional.Consumer<BzzMessage> messageSender) {
this.messageSender = messageSender;
}