Skip to content

Commit e9207b9

Browse files
Added owns function to AccountParty.
1 parent acb50e4 commit e9207b9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=onixlabs-corda-identity-framework
22
group=io.onixlabs
3-
version=4.0.0-rc1
3+
version=4.0.0-rc2
44
onixlabs.development.jarsign.keystore=../lib/onixlabs.development.pkcs12
55
onixlabs.development.jarsign.password=5891f47942424d2acbe108691fdb5ba258712fca7e4762be4327241ebf3dbfa3

onixlabs-corda-identity-framework-contract/src/main/kotlin/io/onixlabs/corda/identityframework/contract/accounts/AccountParty.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,23 @@ class AccountParty(
4040
val accountType: Class<out Account>
4141
) : AbstractParty(owner.owningKey) {
4242

43+
/**
44+
* @property DELIMITER The delimiter that will be used to format the account party.
45+
*/
4346
companion object {
4447
const val DELIMITER = '@'
4548
}
4649

50+
/**
51+
* Determines whether this [AccountParty] owns the specified [Account].
52+
*
53+
* @param account The account for which to determine ownership.
54+
* @return Returns true if this [AccountParty] owns the specified [Account]; otherwise, false.
55+
*/
56+
fun owns(account: Account): Boolean {
57+
return this == account.toAccountParty()
58+
}
59+
4760
/**
4861
* Gets an account resolver to resolve this [AccountParty] back to the associated [Account].
4962
*

0 commit comments

Comments
 (0)