Annotation Type CollectionMapping


@Target({METHOD,PARAMETER})
@Retention(RUNTIME)
public @interface CollectionMapping
Specifies the behavior of a collection mapping. This can be used to configure ordering, uniqueness and the sort order. The default sort order of SortedSet and SortedMap is the natural order. By using this annotation, the sort order can be overridden.
Since:
1.0.0
Author:
Christian Beikov
  • Optional Element Summary

    Optional Elements 
    Modifier and Type Optional Element Description
    Class<? extends Comparator> comparator
    The comparator that should be used for sorting of the collection.
    boolean forceUnique
    Specifies whether the elements should be forcefully deduplicated if the collection allows duplicates or not.
    boolean ignoreIndex
    Specifies whether the index of the indexed collection should be ignored or not.
    boolean ordered
    Specifies whether entries in the collection should be ordered.
  • Element Details

    • comparator

      Class<? extends Comparator> comparator
      The comparator that should be used for sorting of the collection.
      Returns:
      the comparator used for sorting
      Default:
      java.util.Comparator.class
    • ordered

      boolean ordered
      Specifies whether entries in the collection should be ordered.
      Returns:
      true if ordered, false otherwise
      Default:
      false
    • ignoreIndex

      boolean ignoreIndex
      Specifies whether the index of the indexed collection should be ignored or not.
      Returns:
      true if the index should be ignored, false otherwise
      Default:
      false
    • forceUnique

      boolean forceUnique
      Specifies whether the elements should be forcefully deduplicated if the collection allows duplicates or not.
      Returns:
      true if the elements should be forcefully deduplicated, false otherwise
      Default:
      false