FnFunc is a function hub class containing basic static methods that operate on Objects
Function name | Type | Params | Description |
---|---|---|---|
chain | Function<X,Z> | IFunction<X,Y> fn1 IFunction<? super Y,Z> fn2 | Chains two functions together. The returned function executes the specified functions in sequence, being fn2 executed on the results of fn1. |
ifFalseThen | Function<T,T> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,? extends T> thenFunction | Builds a function that will execute the specified function thenFunction only if the result of executing condition on the target object is false. The built function cannot change the return type (receives T and returns T) because the thenFunction could remain unexecuted, and so the type returned by thenFunction must be the same as the type required as input, in order to keep consistency. |
ifFalseThenElse | Function<T,R> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,R> thenFunction IFunction<? super T,R> elseFunction | Builds a function that will execute the specified function thenFunction only if the result of executing condition on the target object is false, and will execute the specified function elseFunction otherwise. The built function can effectively change the target type (receive T and return R) if both thenFunction and elseFunction return the same type, and this is different than the target type T. |
ifNotNullAndFalseThen | Function<T,T> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,? extends T> thenFunction | Builds a function that will execute the specified function thenFunction only if the target object is not null and the result of executing condition on it is false. The built function cannot change the return type (receives T and returns T) because the thenFunction could remain unexecuted, and so the type returned by thenFunction must be the same as the type required as input, in order to keep consistency. |
ifNotNullAndFalseThenElse | Function<T,R> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,R> thenFunction IFunction<? super T,R> elseFunction | Builds a function that will execute the specified function thenFunction only if the target object is not null and the result of executing condition on the target object is false, and will execute the specified function elseFunction otherwise. The built function can effectively change the target type (receive T and return R) if both thenFunction and elseFunction return the same type, and this is different than the target type T. |
ifNotNullAndTrueThen | Function<T,T> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,? extends T> thenFunction | Builds a function that will execute the specified function thenFunction only if the target object is not null and the result of executing condition on it is true. The built function cannot change the return type (receives T and returns T) because the thenFunction could remain unexecuted, and so the type returned by thenFunction must be the same as the type required as input, in order to keep consistency. |
ifNotNullAndTrueThenElse | Function<T,R> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,R> thenFunction IFunction<? super T,R> elseFunction | Builds a function that will execute the specified function thenFunction only if the target object is not null and the result of executing condition on the target object is true, and will execute the specified function elseFunction otherwise. The built function can effectively change the target type (receive T and return R) if both thenFunction and elseFunction return the same type, and this is different than the target type T. |
ifNotNullThen | Function<T,T> | Type<T> targetType IFunction<? super T,? extends T> thenFunction | Builds a function that will execute the specified function thenFunction only if the target object is not null. The built function cannot change the return type (receives T and returns T) because the thenFunction could remain unexecuted, and so the type returned by thenFunction must be the same as the type required as input, in order to keep consistency. |
ifNotNullThenElse | Function<T,R> | Type<T> targetType IFunction<? super T,R> thenFunction IFunction<? super T,R> elseFunction | Builds a function that will execute the specified function thenFunction only if the target object is not null, and will execute the specified function elseFunction otherwise. The built function can effectively change the target type (receive T and return R) if both thenFunction and elseFunction return the same type, and this is different than the target type T. |
ifNullOrFalseThen | Function<T,T> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,? extends T> thenFunction | Builds a function that will execute the specified function thenFunction only if the target object is null or the result of executing condition on it is false. The built function cannot change the return type (receives T and returns T) because the thenFunction could remain unexecuted, and so the type returned by thenFunction must be the same as the type required as input, in order to keep consistency. |
ifNullOrFalseThenElse | Function<T,R> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,R> thenFunction IFunction<? super T,R> elseFunction | Builds a function that will execute the specified function thenFunction only if the target object is null or the result of executing condition on the target object is false, and will execute the specified function elseFunction otherwise. The built function can effectively change the target type (receive T and return R) if both thenFunction and elseFunction return the same type, and this is different than the target type T. |
ifNullOrTrueThen | Function<T,T> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,? extends T> thenFunction | Builds a function that will execute the specified function thenFunction only if the target object is null or the result of executing condition on it is true. The built function cannot change the return type (receives T and returns T) because the thenFunction could remain unexecuted, and so the type returned by thenFunction must be the same as the type required as input, in order to keep consistency. |
ifNullOrTrueThenElse | Function<T,R> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,R> thenFunction IFunction<? super T,R> elseFunction | Builds a function that will execute the specified function thenFunction only if the target object is null or the result of executing condition on the target object is true, and will execute the specified function elseFunction otherwise. The built function can effectively change the target type (receive T and return R) if both thenFunction and elseFunction return the same type, and this is different than the target type T. |
ifNullThen | Function<T,T> | Type<T> targetType IFunction<? super T,? extends T> thenFunction | Builds a function that will execute the specified function thenFunction only if the target object is null. The built function cannot change the return type (receives T and returns T) because the thenFunction could remain unexecuted, and so the type returned by thenFunction must be the same as the type required as input, in order to keep consistency. |
ifNullThenElse | Function<T,R> | Type<T> targetType IFunction<? super T,R> thenFunction IFunction<? super T,R> elseFunction | Builds a function that will execute the specified function thenFunction only if the target object is null, and will execute the specified function elseFunction otherwise. The built function can effectively change the target type (receive T and return R) if both thenFunction and elseFunction return the same type, and this is different than the target type T. |
ifTrueThen | Function<T,T> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,? extends T> thenFunction | Builds a function that will execute the specified function thenFunction only if the result of executing condition on the target object is true. The built function cannot change the return type (receives T and returns T) because the thenFunction could remain unexecuted, and so the type returned by thenFunction must be the same as the type required as input, in order to keep consistency. |
ifTrueThenElse | Function<T,R> | Type<T> targetType IFunction<? super T, Boolean> condition IFunction<? super T,R> thenFunction IFunction<? super T,R> elseFunction | Builds a function that will execute the specified function thenFunction only if the result of executing condition on the target object is true, and will execute the specified function elseFunction otherwise. The built function can effectively change the target type (receive T and return R) if both thenFunction and elseFunction return the same type, and this is different than the target type T. |
whileFalse | Function<T,T> | IFunction<? super T, Boolean> condition IFunction<? super T, T> function | Executes the specified function iteratively (first on the target, then on the result of the previous iteration) while the result of executing the condition function on the target object (or the result of the previous function iteration) is false. |
whileTrue | Function<T,T> | IFunction<? super T, Boolean> condition IFunction<? super T, T> function | Executes the specified function iteratively (first on the target, then on the result of the previous iteration) while the result of executing the condition function on the target object (or the result of the previous function iteration) is true. |