Add spaces after commas in Functions.java
Add spaces after commas as per the project's Checkstyle rules.
This commit is contained in:
parent
028c9ec70c
commit
962e529984
|
@ -55,7 +55,7 @@ public class Functions {
|
||||||
void run() throws T;
|
void run() throws T;
|
||||||
}
|
}
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface FailableCallable<O,T extends Throwable> {
|
public interface FailableCallable<O, T extends Throwable> {
|
||||||
/**
|
/**
|
||||||
* Calls the callable.
|
* Calls the callable.
|
||||||
* @return The value returned from the callable
|
* @return The value returned from the callable
|
||||||
|
@ -64,7 +64,7 @@ public class Functions {
|
||||||
O call() throws T;
|
O call() throws T;
|
||||||
}
|
}
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface FailableConsumer<O,T extends Throwable> {
|
public interface FailableConsumer<O, T extends Throwable> {
|
||||||
/**
|
/**
|
||||||
* Accepts the consumer.
|
* Accepts the consumer.
|
||||||
* @param pObject the parameter for the consumable to accept
|
* @param pObject the parameter for the consumable to accept
|
||||||
|
@ -73,7 +73,7 @@ public class Functions {
|
||||||
void accept(O pObject) throws T;
|
void accept(O pObject) throws T;
|
||||||
}
|
}
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface FailableBiConsumer<O1,O2,T extends Throwable> {
|
public interface FailableBiConsumer<O1, O2, T extends Throwable> {
|
||||||
/**
|
/**
|
||||||
* Accepts the consumer.
|
* Accepts the consumer.
|
||||||
* @param pObject1 the first parameter for the consumable to accept
|
* @param pObject1 the first parameter for the consumable to accept
|
||||||
|
@ -83,7 +83,7 @@ public class Functions {
|
||||||
void accept(O1 pObject1, O2 pObject2) throws T;
|
void accept(O1 pObject1, O2 pObject2) throws T;
|
||||||
}
|
}
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface FailableFunction<I,O,T extends Throwable> {
|
public interface FailableFunction<I, O, T extends Throwable> {
|
||||||
/**
|
/**
|
||||||
* Apply the function.
|
* Apply the function.
|
||||||
* @param pInput the input for the function
|
* @param pInput the input for the function
|
||||||
|
@ -93,7 +93,7 @@ public class Functions {
|
||||||
O apply(I pInput) throws T;
|
O apply(I pInput) throws T;
|
||||||
}
|
}
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface FailableBiFunction<I1,I2,O,T extends Throwable> {
|
public interface FailableBiFunction<I1, I2, O, T extends Throwable> {
|
||||||
/**
|
/**
|
||||||
* Apply the function.
|
* Apply the function.
|
||||||
* @param pInput1 the first input for the function
|
* @param pInput1 the first input for the function
|
||||||
|
@ -104,7 +104,7 @@ public class Functions {
|
||||||
O apply(I1 pInput1, I2 pInput2) throws T;
|
O apply(I1 pInput1, I2 pInput2) throws T;
|
||||||
}
|
}
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface FailablePredicate<O,T extends Throwable> {
|
public interface FailablePredicate<O, T extends Throwable> {
|
||||||
/**
|
/**
|
||||||
* Test the predicate.
|
* Test the predicate.
|
||||||
* @param pObject the object to test the predicate on
|
* @param pObject the object to test the predicate on
|
||||||
|
@ -114,7 +114,7 @@ public class Functions {
|
||||||
boolean test(O pObject) throws T;
|
boolean test(O pObject) throws T;
|
||||||
}
|
}
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface FailableBiPredicate<O1,O2,T extends Throwable> {
|
public interface FailableBiPredicate<O1, O2, T extends Throwable> {
|
||||||
/**
|
/**
|
||||||
* Test the predicate.
|
* Test the predicate.
|
||||||
* @param pObject1 the first object to test the predicate on
|
* @param pObject1 the first object to test the predicate on
|
||||||
|
@ -145,7 +145,7 @@ public class Functions {
|
||||||
* @param <T> the type of checked exception the callable may throw
|
* @param <T> the type of checked exception the callable may throw
|
||||||
* @return the value returned from the callable
|
* @return the value returned from the callable
|
||||||
*/
|
*/
|
||||||
public static <O,T extends Throwable> O call(FailableCallable<O,T> pCallable) {
|
public static <O, T extends Throwable> O call(FailableCallable<O, T> pCallable) {
|
||||||
try {
|
try {
|
||||||
return pCallable.call();
|
return pCallable.call();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
@ -160,7 +160,7 @@ public class Functions {
|
||||||
* @param <O> the type the consumer accepts
|
* @param <O> the type the consumer accepts
|
||||||
* @param <T> the type of checked exception the consumer may throw
|
* @param <T> the type of checked exception the consumer may throw
|
||||||
*/
|
*/
|
||||||
public static <O,T extends Throwable> void accept(FailableConsumer<O,T> pConsumer, O pObject) {
|
public static <O, T extends Throwable> void accept(FailableConsumer<O, T> pConsumer, O pObject) {
|
||||||
try {
|
try {
|
||||||
pConsumer.accept(pObject);
|
pConsumer.accept(pObject);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
@ -177,7 +177,7 @@ public class Functions {
|
||||||
* @param <O2> the type of the second argument the consumer accepts
|
* @param <O2> the type of the second argument the consumer accepts
|
||||||
* @param <T> the type of checked exception the consumer may throw
|
* @param <T> the type of checked exception the consumer may throw
|
||||||
*/
|
*/
|
||||||
public static <O1,O2,T extends Throwable> void accept(FailableBiConsumer<O1,O2,T> pConsumer, O1 pObject1, O2 pObject2) {
|
public static <O1, O2, T extends Throwable> void accept(FailableBiConsumer<O1, O2, T> pConsumer, O1 pObject1, O2 pObject2) {
|
||||||
try {
|
try {
|
||||||
pConsumer.accept(pObject1, pObject2);
|
pConsumer.accept(pObject1, pObject2);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
@ -194,7 +194,7 @@ public class Functions {
|
||||||
* @param <T> the type of checked exception the function may throw
|
* @param <T> the type of checked exception the function may throw
|
||||||
* @return the value returned from the function
|
* @return the value returned from the function
|
||||||
*/
|
*/
|
||||||
public static <I,O,T extends Throwable> O apply(FailableFunction<I,O,T> pFunction, I pInput) {
|
public static <I, O, T extends Throwable> O apply(FailableFunction<I, O, T> pFunction, I pInput) {
|
||||||
try {
|
try {
|
||||||
return pFunction.apply(pInput);
|
return pFunction.apply(pInput);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
@ -213,7 +213,7 @@ public class Functions {
|
||||||
* @param <T> the type of checked exception the function may throw
|
* @param <T> the type of checked exception the function may throw
|
||||||
* @return the value returned from the function
|
* @return the value returned from the function
|
||||||
*/
|
*/
|
||||||
public static <I1,I2,O,T extends Throwable> O apply(FailableBiFunction<I1,I2,O,T> pFunction, I1 pInput1, I2 pInput2) {
|
public static <I1, I2, O, T extends Throwable> O apply(FailableBiFunction<I1, I2, O, T> pFunction, I1 pInput1, I2 pInput2) {
|
||||||
try {
|
try {
|
||||||
return pFunction.apply(pInput1, pInput2);
|
return pFunction.apply(pInput1, pInput2);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
@ -229,7 +229,7 @@ public class Functions {
|
||||||
* @param <T> the type of checked exception the predicate may throw
|
* @param <T> the type of checked exception the predicate may throw
|
||||||
* @return the boolean value returned by the predicate
|
* @return the boolean value returned by the predicate
|
||||||
*/
|
*/
|
||||||
public static <O,T extends Throwable> boolean test(FailablePredicate<O,T> pPredicate, O pObject) {
|
public static <O, T extends Throwable> boolean test(FailablePredicate<O, T> pPredicate, O pObject) {
|
||||||
try {
|
try {
|
||||||
return pPredicate.test(pObject);
|
return pPredicate.test(pObject);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
@ -247,7 +247,7 @@ public class Functions {
|
||||||
* @param <T> the type of checked exception the predicate may throw
|
* @param <T> the type of checked exception the predicate may throw
|
||||||
* @return the boolean value returned by the predicate
|
* @return the boolean value returned by the predicate
|
||||||
*/
|
*/
|
||||||
public static <O1,O2,T extends Throwable> boolean test(FailableBiPredicate<O1,O2,T> pPredicate, O1 pObject1, O2 pObject2) {
|
public static <O1, O2, T extends Throwable> boolean test(FailableBiPredicate<O1, O2, T> pPredicate, O1 pObject1, O2 pObject2) {
|
||||||
try {
|
try {
|
||||||
return pPredicate.test(pObject1, pObject2);
|
return pPredicate.test(pObject1, pObject2);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
@ -279,9 +279,9 @@ public class Functions {
|
||||||
*/
|
*/
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
public static void tryWithResources(FailableRunnable<? extends Throwable> pAction,
|
public static void tryWithResources(FailableRunnable<? extends Throwable> pAction,
|
||||||
FailableConsumer<Throwable,? extends Throwable> pErrorHandler,
|
FailableConsumer<Throwable, ? extends Throwable> pErrorHandler,
|
||||||
FailableRunnable<? extends Throwable>... pResources) {
|
FailableRunnable<? extends Throwable>... pResources) {
|
||||||
final FailableConsumer<Throwable,? extends Throwable> errorHandler;
|
final FailableConsumer<Throwable, ? extends Throwable> errorHandler;
|
||||||
if (pErrorHandler == null) {
|
if (pErrorHandler == null) {
|
||||||
errorHandler = (t) -> rethrow(t);
|
errorHandler = (t) -> rethrow(t);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue