
io.imunity.furms.ui.utils.OptionalException Maven / Gradle / Ivy
/*
* Copyright (c) 2020 Bixbit s.c. All rights reserved.
* See LICENSE file for licensing information.
*/
package io.imunity.furms.ui.utils;
import java.util.Optional;
public class OptionalException {
private final T value;
private final FrontException exception;
private OptionalException(T value, FrontException exception) {
this.value = value;
this.exception = exception;
}
public Optional getValue() {
return Optional.ofNullable(value);
}
public Optional getException(){
return Optional.ofNullable(exception);
}
public static OptionalException of(T vale){
return new OptionalException<>(vale, null);
}
public static OptionalException of(FrontException throwable){
return new OptionalException<>(null, throwable);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy