Class Switch.SwitchBuilder<V>

  • Type Parameters:
    V - the type parameter
    Enclosing class:
    Switch<T>

    public static class Switch.SwitchBuilder<V>
    extends Object
    The type Switch builder.
    • Constructor Detail

      • SwitchBuilder

        public SwitchBuilder()
    • Method Detail

      • instanceOf

        public <T> void instanceOf​(@NonNull
                                   @NonNull Class<? super T> clazz,
                                   V value)
        Instance of.
        Type Parameters:
        T - the type parameter
        Parameters:
        clazz - the clazz
        value - the value
      • instanceOf

        public <T> void instanceOf​(@NonNull
                                   @NonNull Class<? super T> clazz,
                                   @NonNull
                                   @NonNull SerializableFunction<T,​V> function)
        Instance of.
        Type Parameters:
        T - the type parameter
        Parameters:
        clazz - the clazz
        function - the function
      • equals

        public <T> void equals​(@NonNull
                               T targetValue,
                               @NonNull
                               V returnValue)
        Equals.
        Type Parameters:
        T - the type parameter
        Parameters:
        targetValue - the target value
        returnValue - the return value
      • equals

        public <T> void equals​(T value,
                               @NonNull
                               @NonNull SerializableFunction<T,​V> function)
        Equals.
        Type Parameters:
        T - the type parameter
        Parameters:
        value - the value
        function - the function
      • isNull

        public <T> void isNull​(@NonNull
                               @NonNull SerializableFunction<T,​V> function)
        Is null.
        Type Parameters:
        T - the type parameter
        Parameters:
        function - the function
      • when

        public <T> void when​(SerializablePredicate<? super T> predicate,
                             @NonNull
                             @NonNull SerializableFunction<T,​V> function)
        When.
        Type Parameters:
        T - the type parameter
        Parameters:
        predicate - the predicate
        function - the function
      • when

        public <T,​R> void when​(SerializablePredicate<? super T> predicate,
                                     @NonNull
                                     @NonNull SerializableFunction<T,​R> mapper,
                                     @NonNull
                                     @NonNull SerializableFunction<R,​V> function)
        When.
        Type Parameters:
        T - the type parameter
        R - the type parameter
        Parameters:
        predicate - the predicate
        mapper - the mapper
        function - the function
      • defaultAction

        public void defaultAction​(@NonNull
                                  @NonNull SerializableFunction<?,​V> function)
        Default action.
        Parameters:
        function - the function
      • defaultValue

        public void defaultValue​(V value)
        Default value.
        Parameters:
        value - the value
      • defaultNull

        public void defaultNull()
        Default null.