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

io.dropwizard.jersey.params.LongParam Maven / Gradle / Ivy

There is a newer version: 5.0.0-rc.1
Show newest version
package io.dropwizard.jersey.params;

import javax.annotation.Nullable;

/**
 * A parameter encapsulating long values. All non-decimal values will return a {@code 400 Bad
 * Request} response.
 */
public class LongParam extends AbstractParam {
    public LongParam(@Nullable String input) {
        super(input);
    }

    public LongParam(@Nullable String input, String parameterName) {
        super(input, parameterName);
    }

    @Override
    protected String errorMessage(Exception e) {
        return "%s is not a number.";
    }

    @Override
    protected Long parse(@Nullable String input) {
        return Long.valueOf(input);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy