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

javax0.jamal.tools.param.IntegerParameter Maven / Gradle / Ivy

There is a newer version: 2.8.1
Show newest version
package javax0.jamal.tools.param;

import javax0.jamal.api.BadSyntax;
import javax0.jamal.tools.Params;

public class IntegerParameter extends AbstractTypedParameter {

    public IntegerParameter(Params.Param param) {
        super(param);
    }

    public int get() throws BadSyntax {
        return param.get();
    }

    public IntegerParameter required() {
        return this;
    }

    public IntegerParameter optional() {
        return defaultValue(0);
    }

    public IntegerParameter defaultValue(Integer dV) {
        if (dV == null) {
            param.orElseNull();
        } else {
            param.defaultValue(dV);
        }
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy