Package org.iogp.gigs

Class Factories

Object
Factories

public class Factories extends Object
A container for various factory implementations. This is used as a replacement for long list of arguments in constructors when a test may require many factories for different kinds of objects (datum, coordinate system, operations, etc).

Implementations can create a Factories subclass and initialize all fields in their constructor.

Since:
1.0
  • Field Details

  • Constructor Details

    • Factories

      protected Factories()
      Creates an initially empty set of factories.
  • Method Details

    • get

      public final <T> Optional<T> get(Class<T> type)
      Returns the factory to test for the specified type. This method returns the value of one of the type defined in this class. The field is identified by the value type. For example get(CRSFactory.class) returns crsFactory.
      Type Parameters:
      T - compile-time value of the type argument.
      Parameters:
      type - GeoAPI interface of the desired factory.
      Returns:
      factory for the specified interface.
    • isSupported

      public static boolean isSupported(Class<?> type)
      Returns true if the given type is supported by the get(…) method. Note that a true value does not guarantee that get(type) will return a non-empty value, because the type may be supported with no value has been specified.
      Parameters:
      type - GeoAPI interface of a factory.
      Returns:
      whether the given type is supported.