我知道网上有很多关于这个问题的材料,但是我还没有找到任何可以向我这样的菜鸟解释清楚这个问题的材料......如果有人能帮助我理解这两种服务之间的主要区别,不胜感激用例与现实生活中的例子。谢谢!
我的问题有点棘手。我有一个像这样的案例类
case class Foo(
id: String,
name: String,
field1: Boolean,
field2: Boolean,
field3: Boolean,
field4: Boolean
)
Run Code Online (Sandbox Code Playgroud)
但是,我有两种类型的输入,一种非常适合 case class Foo。另一个是缺少field3and 的值field4,看起来
{id: "Test", name: "Test", field1: true, field2: true}我想创建一个Decoder[Foo]适用于这两种情况的值,如果缺少输入field3and field4,只需设置一个默认值false。那可能吗?
例如,
(1)对于输入{id: "Test", name: "Test", field1: true, field2: true},我想将其解码为
Foo("Test, "Test", true, true, false, flase)
Run Code Online (Sandbox Code Playgroud)
(2)对于输入{id: "Test", name: "Test", field1: true, field2: true, field3: true, field4: false},我想将其解码为
Foo("Test, "Test", true, true, true, …Run Code Online (Sandbox Code Playgroud) 我正在使用 PowerShell 并想要执行which命令,但是我看到此错误:
which : The term 'which' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ which xxxxxx
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (which:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Run Code Online (Sandbox Code Playgroud)
我在谷歌上进行了搜索,但没有针对我的问题的具体答案。以前有人遇到过同样的错误吗?我该如何修复它?