
net.alloyggp.escaperope.NullBehavior Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of escape-rope Show documentation
Show all versions of escape-rope Show documentation
A library for turning structured data into strings and back.
package net.alloyggp.escaperope;
public enum NullBehavior {
KEEP,
MAKE_EMPTY,
THROW,
;
//Keep out of the API
/*package-private*/ String apply(String input) {
// return applyFunction.apply(input);
if (this == KEEP) {
return input;
} else if (this == MAKE_EMPTY) {
return (input != null) ? input : "";
} else {
if (input == null) {
throw new IllegalArgumentException("Cannot have a null input");
}
return input;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy