All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.alloyggp.escaperope.NullBehavior Maven / Gradle / Ivy

There is a newer version: 0.0.5
Show newest version
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