我有一个使用Scala的Play应用程序。当前工作版本使用:
游戏框架:2.5.18 Scala:2.11.7 Sbt:0.13.11
但是,当我将以上内容升级到以下版本时,一切都中断了:
游戏框架:2.6.17 Scala:2.12.6 Sbt:1.1.6
而且一切都中断了,我的意思是当我在IDE(Intellij)中重新加载sbt时,它失败并显示以下错误:
Error while importing sbt project:
[info] Loading settings from idea.sbt ...
[info] Loading global plugins from /Users/me/.sbt/1.0/plugins
[info] Loading project definition from /project/project
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /project
[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn] * org.webjars:webjars-locator-core:0.33 is selected over 0.32
[warn] +- com.typesafe:npm_2.12:1.2.1 (depends on 0.32)
[warn] +- com.typesafe.sbt:sbt-web:1.4.3 (scalaVersion=2.12, sbtVersion=1.0) (depends on 0.32)
[warn] …Run Code Online (Sandbox Code Playgroud) 谁能解释一下 currentprovider 和给定provider 之间有什么区别?
我是这样想的。
givenprovider通过网络浏览器连接到区块链,并通过
currentprovider元掩码连接到区块链。
我不确定我的理解是否正确。
你有什么主意吗?
我正在使用axon 2.3.1,我有一个聚合类
public class MyAggregate extends AbstractAnnotatedAggregateRoot<MBAggregate> {
@AggregateIdentifier
private MyId Id;
private Circle circle;
EventDispatcher a=new EventDispatcher();
public MyAggregate() {
}
@CommandHandler
public MyAggregate(NewCommand command ) {
apply(new SmallEvent(command.getId(), command.getCircle()));
}
@CommandHandler
public MyAggregate( StoreDestinationsCommand command ) {
apply(new BigEvent(command.getId(), command.getCircle()));
}
//And some event handlers like
@EventHandler
public void onSmallEvent(SmallEvent event)
{
//Some logic here
}
@EventHandler
public void onBigEvent(BigEvent event)
{
//Some logic here
}
Run Code Online (Sandbox Code Playgroud)
现在我希望这些事件处理程序包含在其他类中,并在触发该事件时调用
public class EventContainer {
private static final long serialVersionUID = -6640657879730853388L; …Run Code Online (Sandbox Code Playgroud) 如果某些条件对于 Some 中的值成立,我希望能够将 a 转换Some为 a 。None
例如,如果我有Some(false)它应该变成 a None,而Some(true)应该保留为Some(true)
我找到了一些方法来做到这一点。
let value1: Option<bool> = Some(false);
let value2: Option<bool> = Some(true);
let result1 = value1.and_then(|inner| if inner == false { None } else { Some(inner) });
let result2 = value2.and_then(|inner| if inner == false { None } else { Some(inner) });
println!("{:?}", result1); // Prints "None"
println!("{:?}", result2); // Prints "Some(true)"
Run Code Online (Sandbox Code Playgroud)
甚至这个
let value1: Option<bool> = Some(false);
let value2: Option<bool> = …Run Code Online (Sandbox Code Playgroud)