This package provides Java Collections views onto entity relationships.

Many entity relationships model common data structures, such as maps or sets. However, manipulating and querying these relationships is not always straightforward. The purpose of this package is to provide higher-level views onto common types of entity relationships. These views are expressed in terms of the Java Collections API, which has a couple advantages. First, it is an API that is familiar and natural to Java programmers. Second, because the Java Collections classes are so common, many algorithms and utilities have been written against them. By providing Java Collection views on entity relationships, application programmers can take advantage of these utilities with their entities.

Note that the purpose of the classes in this package is not to provide efficient implementations of the Java Collections interfaces. For example, {@link com.guidewire.commons.metadata.collections.BeanArrayMap} does not provide the O(1) complexity that users of {@link java.util.HashMap} expect. Most of the operations work by iterating over the elements in the underlying array, and so lookups are going to be O(n).

Current implementations include

Currently, these implementations require {@link com.guidewire.commons.entity.type.EntityPropertyInfo} instances in order to access values on the relationship entity. As a future improvement, these could be perhaps be relaxed to take something more generic, like {@link com.guidewire.commons.gosu.parser.IPropertyAccessor}, in order to represent, e.g., maps in which the key is defined by more than one column, or in which the relationship entity itself is the value. Future implementations may include {@link java.util.SortedSet} and {@link java.util.SortedMap} (currently in the works in my spare time). @author Paul D'Albora