【问题标题】:Corda: what is the difference between class [Party] and [Party?]?Corda:类 [Party] 和 [Party?] 有什么区别?
【发布时间】:2019-06-25 04:34:47
【问题描述】:

帐户中的 [Party] 和 [Party?] 有什么区别?

这里是关于帐户的链接:https://github.com/corda/accounts/tree/release/pre/1/v4

我可以将 [Party?] 的对象转换为 [Party] 吗?

【问题讨论】:

    标签: corda


    【解决方案1】:

    [Party?] 表示对象可以为 null 或 [Party] 类对象。这是 Kotlin 的方式来指示对象可以为 null 或特定对象。

    在代码中:

    // Returns the Party which hosts the account specified by account ID.
        fun hostForAccount(accountId: UUID): Party?
    

    这基本上意味着返回类型可以是 null 或 [Party] 对象。

    PS:[Party] 是 Corda 类

    【讨论】:

      猜你喜欢
      • 2018-11-17
      • 2012-10-23
      • 2021-08-30
      • 2018-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-20
      相关资源
      最近更新 更多