Table of Contents
All multi-valued properties follow a specific pattern of accessors. There is always a getXXX() method which returns a collection; a setXXX() method which takes an array of the type of value to be assigned to the property; and an addXXX() function which takes a single instance of the type of value to be assigned to the property. The setXXX() function may be invoked with a null parameter causes the property value to be cleared.
The TM4J API guarantees to never return a null value for the getXXX() accessor of a multi-valued property - if the object has no values at all for that property, an empty Collection is returned. This means that code such as the following will execute correctly:
Iterator typesIt = topic.getTypes().iterator();
This guaruntee of no null return values does not apply to properties which only have a single value - in those cases, the null return value indicates that the property is not set for that object.