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

nl.pvanassen.geckoboard.api.json.bulletgraph.Position Maven / Gradle / Ivy

The newest version!
package nl.pvanassen.geckoboard.api.json.bulletgraph;

import nl.pvanassen.geckoboard.api.error.ValidationException;

/**
 * Bullet graph position object
 *
 * @author Paul van Assen
 */
public class Position {

    private final int start;

    private final int end;

    public Position(int start, int end) {
        super();
        this.start = start;
        this.end = end;
    }

    protected void validate() throws ValidationException {
        if (start < 0) {
            throw new ValidationException("start", "Start position cannot be less than 0");
        }
        if (end < 0) {
            throw new ValidationException("end", "End position cannot be less than 0");
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy