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

weiboclient4j.params.LongParam Maven / Gradle / Ivy

There is a newer version: 0.4.16
Show newest version
package weiboclient4j.params;

/**
 * @author Hover Ruan
 */
public abstract class LongParam implements ParameterAction {
    private long value;

    public LongParam(long value) {
        this.value = value;
    }

    public long getValue() {
        return value;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }

    public boolean isValid() {
        return value > 0;
    }

    protected abstract String paramKey();

    public void addParameter(Parameters params) {
        if (isValid()) {
            params.add(paramKey(), getValue());
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy