Closed DmitryBarskov closed 3 years ago
For #1572:
ScalarWithFallback
FuncWithFallback
Now fallbacks for ScalarWithFallback and FuncWithFallback can produce object derived types from given original type.
Fallback<Long> longOnNoFile = new Fallback.From<>(FileNotFoundException.class, _t -> 0L); Fallback<Double> doubleOnIo = new Fallback.From<>(IOException.class, _t -> 0.0); Fallback<Integer> intOtherwise = new Fallback.From<>(Exception.class, _t -> 0); Func<String, Number> readFileLength = new FuncOf<>(fileName -> { throw new IOException("Access denied. You can't read file " + fileName); }); FuncWithFallback<String, Number> safeReadFileLength = new FuncWithFallback<String, Number>( readFileLength, longOnNoFile, doubleOnIo, intOtherwise );
@rultor merge
@victornoel OK, I'll try to merge now. You can check the progress of the merge here
@victornoel Done! FYI, the full log is here (took me 8min)
@0crat status
@andreoss/z resigned from #1607, since the job is not in scope anymore
For #1572:
ScalarWithFallback
(generify this class sinceFuncWithFallback
depends on it)FuncWithFallback
Now fallbacks for
ScalarWithFallback
andFuncWithFallback
can produce object derived types from given original type.