Class Factory


  • public class Factory
    extends java.lang.Object
    This class can be used by all plugins to get factories and builders for the different types of SEAMCAT
    • Constructor Detail

      • Factory

        public Factory()
    • Method Detail

      • distributionFactory

        public static DistributionFactory distributionFactory()
        Get the factory handling the creation of distributions
        Returns:
        Distribution Factory instance
      • propagationModelFactory

        public static PropagationModelFactory propagationModelFactory()
        Get the factory handling the creation or copy of propagation models
        Returns:
      • prototype

        public static <T> T prototype​(java.lang.Class<T> clazz)
        This method returns the prototype object to be build. The prototype is used in the when method to bind return value for methods, e.g. when( prototype.temperature()).thenReturn( 37.5);
        Returns:
        prototype instance of type T
      • prototype

        public static <T> T prototype​(java.lang.Class<T> clazz,
                                      T t)
        This method returns the prototype object to be build with values according to the argument t. The prototype is used in the when method to bind return value for methods, e.g. when( prototype.temperature()).thenReturn( 37.5);
        Returns:
        prototype instance of type T
      • when

        public static <V> Returner<V> when​(V value)
        Used in conjunction with prototype().
        Specifies what an instance should return by using the prototype.
        Parameters:
        value - method invoked on the prototype. Value only used to generate Returner accepting the correct return value
        Returns:
        Returner object to be passed the actual value to return
      • build

        public static <T> T build​(T prototype)
        method that returns an immutable instance of T.
        Parameters:
        prototype - a prototype instance with recorded return values to be set in the final immutable instance
        Returns:
        immutable instance of T
      • instance

        public static <T> T instance​(java.lang.Class<T> clazz)
      • fromInstance

        public static <T> T fromInstance​(java.lang.Class<T> clazz,
                                         T t)
      • publishEvent

        public static void publishEvent​(java.lang.Object event)