Enum Expressions

    • Method Detail

      • values

        public static Expressions[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Expressions c : Expressions.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Expressions valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • registerMockInstancesForNestedTypes

        public static void registerMockInstancesForNestedTypes​(Class<?> parentClass)
        Registers mock instances for every public static nested class found in parentClass.
        Parameters:
        parentClass - the parentClass to scan for nested public static types
      • registerInstancesForFields

        public static void registerInstancesForFields​(Object instance)
        Registers mocks via Mocks.register(String, Object) for all attributes with Named-types.
        Parameters:
        instance - instance who's fields are registered (maybe Junit test or jbehave steps).
      • registerNewInstancesForNestedTypes

        public static void registerNewInstancesForNestedTypes​(Class<?> parentClass)
        Registers new instances for every public static nested class found in parentClass.
        Parameters:
        parentClass - the parentClass to scan for nested public static types
      • registerMockInstances

        public static void registerMockInstances​(Class<?>... types)
        Creates and registers mock instance for every given type.
        Parameters:
        types - collection of types to mock and register
        See Also:
        registerMockInstances(java.util.Collection)
      • registerMockInstances

        public static void registerMockInstances​(Collection<Class<?>> types)
        Creates and registers mock instance for every given type.
        Parameters:
        types - collection of types to mock and register
      • registerMockInstance

        public static <T> T registerMockInstance​(String name,
                                                 Class<T> type)
        Creates a mock for the given type and registers it.
        Parameters:
        name - the juel name under which the mock is registered
        type - the type of the mock to create
        Returns:
        the registered mock instance
      • registerMockInstance

        public static <T> T registerMockInstance​(Class<T> type)
        Creates a mock for the given type and registers it.
        Parameters:
        type - the type of the mock to create
        Returns:
        the registered mock instance
      • registerNewInstance

        public static <T> T registerNewInstance​(String name,
                                                Class<T> type)
        Creates a new instance for the given type and registers it under the given name.
        Parameters:
        name - the name for the registered instance
        type - the type of the instance to create
        Returns:
        the registered instance
      • registerNewInstance

        public static <T> T registerNewInstance​(Class<T> type)
        Creates a new instance for the given type using the default constructor and registers it.
        Parameters:
        type - the type of the instance to create
        Returns:
        the registered instance
        See Also:
        registerNewInstance(String, Class)
      • registerInstance

        public static <T> T registerInstance​(T instance)
        If you already have the instance, register it directly. Name is guessed via NameForType.
        Parameters:
        instance - the instance or mock to register
        Returns:
        the registered instance
      • registerInstance

        public static <T> T registerInstance​(String name,
                                             T instance)
        Delegates to Mocks.register(String, Object)
        Parameters:
        name - the juel name for the registered instance
        instance - the instance to register
        Returns:
        the registered instance
      • getRegistered

        public static <T> T getRegistered​(String name)
        Parameters:
        name - juel name of the registered instance or mock
        Returns:
        registered instance or mock of type
      • getRegistered

        public static <T> T getRegistered​(Class<?> type)
        Parameters:
        type - the type of the registered instance or mock
        Returns:
        registered instance or mock for type
      • reset

        public static void reset()
        See Also:
        Mocks.reset()