+ public Optional<LengthConstraint> getLengthConstraint() {
+ return Optional.empty();
+ }
+ }
+
+ private static final class DefaultRangeConstraint<T extends Number & Comparable<T>> implements RangeConstraint<T> {
+ private final T min;
+ private final T max;
+
+ DefaultRangeConstraint(final T min, final T max) {
+ this.min = requireNonNull(min);
+ this.max = requireNonNull(max);
+ }
+
+ @Override
+ public Optional<String> getErrorAppTag() {
+ return Optional.empty();
+ }
+
+ @Override
+ public Optional<String> getErrorMessage() {
+ return Optional.empty();
+ }
+
+ @Override
+ public Optional<String> getDescription() {
+ return Optional.empty();
+ }
+
+ @Override
+ public Optional<String> getReference() {
+ return Optional.empty();
+ }
+
+ @Override
+ public RangeSet<T> getAllowedRanges() {
+ return ImmutableRangeSet.of(Range.closed(min, max));