
fitnesse.wikitext.parser.Maybe Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitnesse Show documentation
Show all versions of fitnesse Show documentation
The fully integrated standalone wiki, and acceptance testing framework.
package fitnesse.wikitext.parser;
public class Maybe {
public static final Maybe noString = new Maybe<>("*nothing*", "");
public static final Maybe noDouble = new Maybe<>(0.0, "");
public static final Maybe noInteger = new Maybe<>(0, "");
public static final Maybe noCharacter = new Maybe<>('\0', "");
private final T value;
private final String nothingReason;
public Maybe(T value) { this(value, null); }
public Maybe() { this(null, ""); }
public static Maybe nothingBecause(String nothingReason) {
return new Maybe<>(null, nothingReason);
}
private Maybe(T value, String nothingReason) {
this.value = value;
this.nothingReason = nothingReason;
}
public T getValue() { return value; }
public boolean isNothing() { return nothingReason != null; }
public String because() { return nothingReason; }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy