com.evrythng.commons.validation.preconditions.LessThanOrEqualTo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of evrythng-commons Show documentation
Show all versions of evrythng-commons Show documentation
Public common EVRYTHNG classes.
/*
* (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