Class CollectionFactory

java.lang.Object
eu.bandm.tools.umod.runtime.CollectionFactory

public class CollectionFactory extends Object
Utility class which holds the factory methods for all collection classes needed by a umod model.
  • Method Details

    • newNonNullList

      public static <A> NonNullList<A> newNonNullList(Class<?> elementClass)
      Factory method.
      Type Parameters:
      A - the type of the contained elements.
      Parameters:
      elementClass - the class of the contained elements. (Its type parameter is intentionally not related to the result type.
      Returns:
      the new created and empty collection.
    • newNonNullSet

      public static <A> NonNullSet<A> newNonNullSet(Class<?> elementClass)
      Factory method.
      Type Parameters:
      A - the type of the contained elements.
      Parameters:
      elementClass - the class of the contained elements. (Its type parameter is intentionally not related to the result type.
      Returns:
      the new created and empty collection.
    • newNonNullMap

      public static <A, B> NonNullMap<A,B> newNonNullMap(Class<?> classA, Class<?> classB)
      Factory method.
      Type Parameters:
      A - the type of the contained keys,
      B - the type of the contained values.
      Parameters:
      classA - the classes of the contained keys. (Its type parameter is intentionally not related to the result type.
      classB - the classes of the contained values. (Its type parameter is intentionally not related to the result type.
      Returns:
      the new created and empty collection.
    • newNonNullKeyMap

      public static <A, B> NonNullKeyMap<A,B> newNonNullKeyMap(Class<A> classA, Class<B> classB)
      Factory method.
      Type Parameters:
      A - the type of the contained keys,
      B - the type of the contained values.
      Parameters:
      classA - the classes of the contained keys. (Its type parameter is intentionally not related to the result type.
      classB - the classes of the contained values. (Its type parameter is intentionally not related to the result type.
      Returns:
      the new created and empty collection.
    • newNonNullValueMap

      public static <A, B> NonNullValueMap<A,B> newNonNullValueMap(Class<?> classA, Class<?> classB)
      Factory method.
      Type Parameters:
      A - the type of the contained keys,
      B - the type of the contained values.
      Parameters:
      classA - the classes of the contained keys. (Its type parameter is intentionally not related to the result type.
      classB - the classes of the contained values. (Its type parameter is intentionally not related to the result type.
      Returns:
      the new created and empty collection.
    • newList

      public static <A> List<A> newList(Class<?> elementClass)
      Factory method.
      Type Parameters:
      A - the type of the contained elements.
      Parameters:
      elementClass - the class of the contained elements. (Its type parameter is intentionally not related to the result type.
      Returns:
      the new created and empty collection.
    • newSet

      public static <A> Set<A> newSet(Class<?> elementClass)
      Factory method.
      Type Parameters:
      A - the type of the contained elements.
      Parameters:
      elementClass - the class of the contained elements. (Its type parameter is intentionally not related to the result type.
      Returns:
      the new created and empty collection.
    • newMap

      public static <A, B> Map<A,B> newMap(Class<?> classA, Class<?> classB)
      Factory method.
      Type Parameters:
      A - the type of the contained keys,
      B - the type of the contained values.
      Parameters:
      classA - the classes of the contained keys. (Its type parameter is intentionally not related to the result type.
      classB - the classes of the contained values. (Its type parameter is intentionally not related to the result type.
      Returns:
      the new created and empty collection.
    • newMultimap

      public static <A, B> Multimap<A,B> newMultimap(Class<?> classA, Class<?> classB)
      Factory method.
      Type Parameters:
      A - the type of the left-side values.
      B - the type of the right-side values.
      Parameters:
      classA - the classes of the left-side values. (Its type parameter is intentionally not related to the result type.
      classB - the classes of the right-side values. (Its type parameter is intentionally not related to the result type.
      Returns:
      the new created and empty collection.