net.sergeych.biserializer.BiSerializable
public class RoleLink extends Role
Contract
(with Role.setContract(Contract)
call), then it delegates all actual work to the target role from the contract roles.
This is used to assign roles to roles, and to create special roles for permissions, etc.
Role.RequiredMode
requiredAllReferences, requiredAnyReferences
Constructor | Description |
---|---|
RoleLink(java.lang.String name) |
Deprecated.
|
RoleLink(java.lang.String name,
Contract contract) |
Create empty link role.
|
RoleLink(java.lang.String name,
Contract contract,
java.lang.String roleName) |
Create a link to a named role.
|
RoleLink(java.lang.String name,
java.lang.String roleName) |
Deprecated.
|
Modifier and Type | Method | Description |
---|---|---|
void |
anonymize() |
If this role has public keys, they will be replaced with
AnonymousId . |
void |
deserialize(net.sergeych.tools.Binder data,
net.sergeych.biserializer.BiDeserializer deserializer) |
|
boolean |
equalKeys(Role otherRole) |
Deprecated.
|
protected boolean |
equalsIgnoreNameAndRefs(Role otherRole) |
|
java.util.Set<AnonymousId> |
getAnonymousIds() |
Deprecated.
|
java.util.Set<com.icodici.crypto.KeyAddress> |
getKeyAddresses() |
Deprecated.
|
java.util.Set<KeyRecord> |
getKeyRecords() |
Deprecated.
|
java.util.Set<com.icodici.crypto.PublicKey> |
getKeys() |
Deprecated.
|
@Nullable Role |
getRole() |
Return the resolved role taken from a bound contract.
|
void |
initWithDsl(net.sergeych.tools.Binder serializedRole) |
Initializes linked role from dsl.
|
boolean |
isAllowedForKeysQuantized(java.util.Set<? extends com.icodici.crypto.AbstractKey> keys) |
Check role is allowed to keys
|
boolean |
isValid() |
Check validity of role
|
<T extends Role> |
resolve() |
Return the resolved role.
|
<T extends Role> |
resolve(boolean ignoreRefs) |
|
net.sergeych.tools.Binder |
serialize(net.sergeych.biserializer.BiSerializer s) |
|
java.lang.String |
toString() |
Get role as string.
|
addAllRequiredReferences, addRequiredReference, addRequiredReference, containReference, equalAddresses, equalAnonIds, equals, equalsIgnoreName, fromDslBinder, getAllAddresses, getComment, getContract, getKeyRecord, getName, getReferences, getSimpleAddress, getSpecialReferences, hashCode, isAllowedFor, isAllowedForKeys, isMatchingKeyAddress, isMatchingRole, linkAs, setComment, setContract
public RoleLink(java.lang.String name, Contract contract)
name
- new role namecontract
- is contract role belongs to@Deprecated public RoleLink(java.lang.String name)
name
- new role namepublic RoleLink(java.lang.String name, Contract contract, java.lang.String roleName)
Role.setContract(Contract)
before using the instance.name
- new role namecontract
- is contract role belongs toroleName
- existing role name@Deprecated public RoleLink(java.lang.String name, java.lang.String roleName)
Role.setContract(Contract)
before using the instance.name
- new role nameroleName
- existing role namepublic @Nullable Role getRole()
RoleLink
itself, or null
(if a link is incorrect).Role
public <T extends Role> T resolve()
RoleLink
itself, or null (if a link is incorrect).public <T extends Role> T resolve(boolean ignoreRefs)
@Deprecated public java.util.Set<KeyRecord> getKeyRecords()
getKeyRecords
in class Role
KeyRecord
)@Deprecated public java.util.Set<AnonymousId> getAnonymousIds()
getAnonymousIds
in class Role
AnonymousId
)@Deprecated public java.util.Set<com.icodici.crypto.KeyAddress> getKeyAddresses()
getKeyAddresses
in class Role
KeyAddress
)@Deprecated public java.util.Set<com.icodici.crypto.PublicKey> getKeys()
public boolean isAllowedForKeysQuantized(java.util.Set<? extends com.icodici.crypto.AbstractKey> keys) throws Quantiser.QuantiserException
isAllowedForKeysQuantized
in class Role
keys
- is set of keysQuantiser.QuantiserException
public boolean isValid()
@Deprecated public boolean equalKeys(Role otherRole)
To check that the role can be performed by some other role, use Role.isAllowedForKeys(Set)
.
public void initWithDsl(net.sergeych.tools.Binder serializedRole)
initWithDsl
in class Role
serializedRole
- is Binder
from dsl with data of linked rolepublic java.lang.String toString()
toString
in class java.lang.Object
protected boolean equalsIgnoreNameAndRefs(Role otherRole)
equalsIgnoreNameAndRefs
in class Role
public net.sergeych.tools.Binder serialize(net.sergeych.biserializer.BiSerializer s)
public void deserialize(net.sergeych.tools.Binder data, net.sergeych.biserializer.BiDeserializer deserializer)
deserialize
in interface net.sergeych.biserializer.BiSerializable
deserialize
in class Role
public void anonymize()
AnonymousId
.