com.endeca.portal.data.model
Interface Assignments

All Superinterfaces:
java.lang.Iterable<Assignment>

public interface Assignments
extends java.lang.Iterable<Assignment>

Interface representing zero, one or more assignments to a record. Most normal clients will want to use the Iterable interface to loop over the 0 to N assignments. Some clients want to programmatically interact with a single assignment. Use the getSingleAssignment method which will throw an exception if property has zero or many assignments.


Method Summary
 Assignment getArbitraryAssignment()
          Get a single assignment from a list 1 to n assignments.
 Assignment getSoleAssignment()
          Get the one and only assignment for this potential list of assignments.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getSoleAssignment

Assignment getSoleAssignment()
                             throws ModelException
Get the one and only assignment for this potential list of assignments. This is a utility method for places in our code that expect a record to have a single assignment so it can be acted on programmatically. If the property actually has zero assignments or multiple assignments an exception is thrown.

Returns:
- The one and only one assignment for the attribute.
Throws:
ModelException - - If there are zero or multiple assignments throw an MdexModelExcpetion

getArbitraryAssignment

Assignment getArbitraryAssignment()
Get a single assignment from a list 1 to n assignments. This is a utility method for places in our code that want to return a single assigment from a record regardless of whether it is multi assign or not.

Returns:
- the first assignment the MDEX returns or Assignment of null key/value/navigable value if none