se.bjurr.violations.lib.util.Optional Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of violations-lib Show documentation
Show all versions of violations-lib Show documentation
Library for parsing report files from static code analyzis.
package se.bjurr.violations.lib.util;
import java.io.Serializable;
import java.util.Set;
public abstract class Optional implements Serializable {
private static final long serialVersionUID = 0;
public static Optional absent() {
return Absent.withType();
}
public static Optional fromNullable(final T nullableReference) {
return nullableReference == null ? Optional.absent() : new Present<>(nullableReference);
}
Optional() {}
public abstract Set asSet();
@Override
public abstract boolean equals(Object object);
public abstract T get();
@Override
public abstract int hashCode();
public abstract boolean isPresent();
public abstract T or(T defaultValue);
public abstract T orNull();
@Override
public abstract String toString();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy