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

com.evrythng.commons.validation.preconditions.LessThanOrEqualTo Maven / Gradle / Ivy

There is a newer version: 1.33
Show newest version
/*
 * (c) Copyright 2016 EVRYTHNG Ltd London / Zurich
 * www.evrythng.com
 */

package com.evrythng.commons.validation.preconditions;

public final class LessThanOrEqualTo> extends AbstractPrecondition {

	private static final String NAME = "LESS_THAN_OR_EQUAL_TO";
	private final TARGET maximum;

	public static > LessThanOrEqualTo lessThan(final T maximum) {

		return new LessThanOrEqualTo<>(maximum);
	}

	private LessThanOrEqualTo(final TARGET maximum) {

		super(NAME);
		this.maximum = maximum;
	}

	@Override
	public final boolean test(final TARGET target) {

		return target.compareTo(maximum) <= 0;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy