@@ -16,20 +16,20 @@ public static String getEnvVarByNameAsString(String name){
16
16
17
17
public static Integer getEnvVarByNameAsInteger (String name ){
18
18
return Trier .of (() -> Integer .valueOf (EnvVarRetriever .getEnvVarByNameAsString (name )))
19
- .setHandlerForUnexpectedException (unexpected -> new UnexpectedException (unexpected , name , Integer .class ))
20
- .finishAndExecuteAction ();
19
+ .setUnexpectedExceptionHandler (unexpected -> new UnexpectedException (unexpected , name , Integer .class ))
20
+ .execute ();
21
21
}
22
22
23
23
public static Boolean getEnvVarByNameAsBoolean (String name ){
24
24
return Trier .of (() -> Boolean .valueOf (EnvVarRetriever .getEnvVarByNameAsString (name )))
25
- .setHandlerForUnexpectedException (unexpected -> new UnexpectedException (unexpected , name , Boolean .class ))
26
- .finishAndExecuteAction ();
25
+ .setUnexpectedExceptionHandler (unexpected -> new UnexpectedException (unexpected , name , Boolean .class ))
26
+ .execute ();
27
27
}
28
28
29
29
public static <T > T getEnvVarByName (String name , Class <T > typeToReturn ){
30
30
return Trier .of (() -> EnvVarRetriever .tryToGetEnvVar (name , typeToReturn ))
31
- .setHandlerForUnexpectedException (unexpectedException -> new UnexpectedException (unexpectedException , name , typeToReturn ))
32
- .finishAndExecuteAction ();
31
+ .setUnexpectedExceptionHandler (unexpectedException -> new UnexpectedException (unexpectedException , name , typeToReturn ))
32
+ .execute ();
33
33
}
34
34
35
35
private static <T > T tryToGetEnvVar (String name , Class <T > typeToReturn ) {
0 commit comments