com.zeroleak.throwingsupplier.Either Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of throwing-supplier Show documentation
Show all versions of throwing-supplier Show documentation
Guava cache supplier extension to memoize exceptions, fallback, expiration control.
The newest version!
package com.zeroleak.throwingsupplier;
import java8.util.Optional;
public class Either {
private Optional value;
private Optional fallback;
public Either(T value) {
this(Optional.of(value), Optional.empty());
}
public Either(Optional emptyValue, U fallback) {
this(Optional.empty(), Optional.of(fallback));
}
private Either(Optional value, Optional fallback) {
this.value = value;
this.fallback = fallback;
}
public Optional getValue() {
return value;
}
public Optional getFallback() {
return fallback;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy