net.sergeych.biserializer.BiSerializable
public class Reference
extends java.lang.Object
implements net.sergeych.biserializer.BiSerializable
Modifier and Type | Class | Description |
---|---|---|
static class |
Reference.conditionsModeType |
Modifier and Type | Field | Description |
---|---|---|
HashId |
contract_id |
|
java.util.List<java.lang.String> |
fields |
|
java.util.List<Approvable> |
matchingItems |
|
java.lang.String |
name |
|
HashId |
origin |
|
boolean |
required |
|
java.util.List<java.lang.String> |
roles |
|
java.util.List<Role> |
signed_by |
|
java.lang.String |
transactional_id |
|
int |
type |
|
static int |
TYPE_EXISTING_DEFINITION |
|
static int |
TYPE_EXISTING_STATE |
|
static int |
TYPE_TRANSACTIONAL |
Constructor | Description |
---|---|
Reference() |
Deprecated.
|
Reference(Contract contract) |
adds a basic contract for reference
|
Modifier and Type | Method | Description |
---|---|---|
Reference |
addField(java.lang.String field) |
Add the field for the reference
|
Reference |
addMatchingItem(Approvable a) |
Add the matching item for the reference
|
Reference |
addRole(java.lang.String role) |
Add the roles for the reference
|
void |
deserialize(net.sergeych.tools.Binder data,
net.sergeych.biserializer.BiDeserializer deserializer) |
|
boolean |
equals(Reference a) |
|
boolean |
equals(java.lang.Object obj) |
|
boolean |
equalsIgnoreType(Reference a) |
|
boolean |
equalsIgnoreTypeAndName(Reference a) |
|
net.sergeych.tools.Binder |
exportConditions() |
Export the conditions from the reference as strings
|
static Reference |
fromDslBinder(net.sergeych.tools.Binder ref,
Contract contract) |
|
java.lang.String |
getComment() |
Get comment of the reference
|
net.sergeych.tools.Binder |
getConditions() |
Get the conditions from the reference
|
Contract |
getContract() |
Get the base contract in which the reference is located
|
java.util.List<java.lang.String> |
getFields() |
Get the list of fields from the reference
|
java.util.Set<java.lang.String> |
getInternalReferences() |
|
java.lang.String |
getName() |
Get the name from the reference
|
java.util.List<java.lang.String> |
getRoles() |
Get the list of roles from the reference
|
int |
hashCode() |
|
boolean |
isMatchingWith(Approvable a,
java.util.Collection<Contract> contracts) |
Deprecated.
|
boolean |
isMatchingWithQuantized(Approvable a,
java.util.Collection<Contract> contracts,
Quantiser quantiser) |
Check if given item matching with current reference criteria
|
boolean |
isValid() |
Check if reference is valid i.e.
|
void |
quantize(Quantiser quantiser,
int neighboursCount) |
Method quantizes all the conditions of the reference, i.e.
|
net.sergeych.tools.Binder |
serialize(net.sergeych.biserializer.BiSerializer s) |
|
void |
setComment(java.lang.String comment) |
Set comment of the reference
|
Reference |
setConditions(net.sergeych.tools.Binder conditions) |
Set the conditions from the reference
|
Reference |
setContract(Contract contract) |
Set the base contract from the reference
|
Reference |
setFields(java.util.List<java.lang.String> fields) |
Set the list of fields for the reference
|
Reference |
setName(java.lang.String name) |
Set the name for the reference
|
Reference |
setRoles(java.util.List<java.lang.String> roles) |
Set the list of roles for the reference
|
java.lang.String |
toString() |
public java.lang.String name
public int type
public java.lang.String transactional_id
public HashId contract_id
public boolean required
public HashId origin
public java.util.List<Role> signed_by
public java.util.List<java.lang.String> fields
public java.util.List<java.lang.String> roles
public java.util.List<Approvable> matchingItems
public static final int TYPE_TRANSACTIONAL
public static final int TYPE_EXISTING_DEFINITION
public static final int TYPE_EXISTING_STATE
@Deprecated public Reference()
public Reference(Contract contract)
contract
- basic contract.public void deserialize(net.sergeych.tools.Binder data, net.sergeych.biserializer.BiDeserializer deserializer)
deserialize
in interface net.sergeych.biserializer.BiSerializable
public net.sergeych.tools.Binder serialize(net.sergeych.biserializer.BiSerializer s)
serialize
in interface net.sergeych.biserializer.BiSerializable
public static Reference fromDslBinder(net.sergeych.tools.Binder ref, Contract contract)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean equalsIgnoreTypeAndName(Reference a)
public boolean equalsIgnoreType(Reference a)
public boolean equals(Reference a)
public int hashCode()
hashCode
in class java.lang.Object
public void quantize(Quantiser quantiser, int neighboursCount) throws Quantiser.QuantiserException
quantiser
- quantizer cost of the contractneighboursCount
- the number of contracts that are checked for compliance with the referenceQuantiser.QuantiserException
- if processing cost limit is gotpublic boolean isValid()
@Deprecated public boolean isMatchingWith(Approvable a, java.util.Collection<Contract> contracts)
a
- item to check for matchingcontracts
- contract list to check for matchingpublic boolean isMatchingWithQuantized(Approvable a, java.util.Collection<Contract> contracts, Quantiser quantiser) throws Quantiser.QuantiserException
a
- item to check for matchingcontracts
- contract list to check for matchingquantiser
- quantizer cost of the contractQuantiser.QuantiserException
- if processing cost limit is gotpublic java.lang.String getName()
public Reference setName(java.lang.String name)
public java.lang.String getComment()
public void setComment(java.lang.String comment)
comment
- of the referencepublic java.util.List<java.lang.String> getRoles()
public Reference addRole(java.lang.String role)
public Reference setRoles(java.util.List<java.lang.String> roles)
public java.util.List<java.lang.String> getFields()
public Reference addField(java.lang.String field)
public Reference setFields(java.util.List<java.lang.String> fields)
public net.sergeych.tools.Binder getConditions()
public net.sergeych.tools.Binder exportConditions()
public Reference setConditions(net.sergeych.tools.Binder conditions)
public Reference addMatchingItem(Approvable a)
public Contract getContract()
public Reference setContract(Contract contract)
public java.util.Set<java.lang.String> getInternalReferences()
public java.lang.String toString()
toString
in class java.lang.Object