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

io.dropwizard.jersey.jsr310.YearParam Maven / Gradle / Ivy

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

import io.dropwizard.jersey.params.AbstractParam;

import javax.annotation.Nullable;
import java.time.Year;

/**
 * A parameter encapsulating year values. All non-parsable values will return a {@code 400 Bad
 * Request} response.
 *
 * @see java.time.YearMonth
 */
public class YearParam extends AbstractParam {
    public YearParam(@Nullable final String input) {
        super(input);
    }

    @Override
    protected Year parse(@Nullable final String input) throws Exception {
        return Year.parse(input);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy