Package com.isode.dsapi.config
Class AgreementTuple
java.lang.Object
com.isode.dsapi.config.AgreementTuple
- All Implemented Interfaces:
Comparable<AgreementTuple>
A shadow agreement is uniquely identified with three pieces of
information, which are held in an AgreementTuple.
Objects of this class may be used as keys for HashMaps etc., and because
they are comparable will be ordered properly if used as a key for
a SortedMap.
- Since:
- 15.1
-
Constructor Summary
ConstructorsConstructorDescriptionAgreementTuple
(DN areaName, DN supplierDN, DN consumerDN) Construct a new tuple. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(AgreementTuple other) Compare for sort ordering.boolean
Compares two objects for equality.Determine the area DN represented by this agreementDetermine the DN of the consumer DSA for this agreementDetermine the DN of the supplier DSA for this agreementint
hashCode()
toString()
-
Constructor Details
-
AgreementTuple
Construct a new tuple.- Parameters:
areaName
- area name. Must not be null.supplierDN
- supplier DSA's DN. Must not be null.consumerDN
- consumer DSA's DN. Must not be null.
-
-
Method Details
-
getAreaName
Determine the area DN represented by this agreement- Returns:
- the area name, which will never be null.
-
getSupplierDN
Determine the DN of the supplier DSA for this agreement- Returns:
- supplier DSA's DN, which will never be null.
-
getConsumerDN
Determine the DN of the consumer DSA for this agreement- Returns:
- consumer DSA's DN, which will never be null.
-
equals
Compares two objects for equality. -
hashCode
public int hashCode() -
toString
-
compareTo
Compare for sort ordering. Ordering is performed by comparing the areaName, then supplierDN, then consumerDN. For example area:c=aa is always "less than" area:c=bb regardless of who supplier and consumer are.This means if you sort a list of tuples you'll get something like.
- c=aa supplied from Z to B
- c=aa supplied from Z to C
- c=bb supplied from A to B
- c=cc supplied from A to D
- c=dd supplied from A to B
- c=dd supplied from Z to B
- Specified by:
compareTo
in interfaceComparable<AgreementTuple>
- Parameters:
other
- another AgreementTuple. Must not be null.- Returns:
- -1 if this object is "less than" other; 0 if they are "equal", or 1 if it is "greater than" other
-