Class BeanSupplier.DefaultBeanSupplier<T>

  • All Implemented Interfaces:
    java.util.function.Supplier<T>, BeanSupplier<T>
    Enclosing interface:
    BeanSupplier<T>

    public static class BeanSupplier.DefaultBeanSupplier<T>
    extends java.lang.Object
    implements BeanSupplier<T>
    • Constructor Detail

      • DefaultBeanSupplier

        public DefaultBeanSupplier()
    • Method Detail

      • get

        public T get()
        Specified by:
        get in interface BeanSupplier<T>
        Specified by:
        get in interface java.util.function.Supplier<T>
      • when

        @CanIgnoreReturnValue
        public BeanSupplier<T> when​(java.util.function.Supplier<java.lang.Boolean> conditionSupplier)
        Description copied from interface: BeanSupplier
        Specify condition for bean supplier to create beans.
        Specified by:
        when in interface BeanSupplier<T>
        Parameters:
        conditionSupplier - the condition supplier
        Returns:
        the bean supplier
      • supply

        @CanIgnoreReturnValue
        public BeanSupplier<T> supply​(java.util.function.Supplier<T> beanSupplier)
        Description copied from interface: BeanSupplier
        Create the bean via a given supplier when condition passes.
        Specified by:
        supply in interface BeanSupplier<T>
        Parameters:
        beanSupplier - the bean supplier
        Returns:
        the bean supplier
      • otherwise

        @CanIgnoreReturnValue
        public BeanSupplier<T> otherwise​(java.util.function.Supplier<T> beanSupplier)
        Description copied from interface: BeanSupplier
        Create the proxy bean via a given supplier when the condition fails.
        Specified by:
        otherwise in interface BeanSupplier<T>
        Parameters:
        beanSupplier - the bean supplier
        Returns:
        the bean supplier
      • otherwiseProxy

        @CanIgnoreReturnValue
        public BeanSupplier<T> otherwiseProxy()
        Description copied from interface: BeanSupplier
        Create the proxy bean via a given supplier when the condition fails.
        Specified by:
        otherwiseProxy in interface BeanSupplier<T>
        Returns:
        the bean supplier