private RangeInclusiveL(long lower, long upper) { this.lower = lower; this.upper = upper; this.interval = RangeInclusiveLType.super.interval(); }
/** * <p> Determine if the given value is included in this range. </p> * * @param value The given value * * @return {@code true} iff {@code value >= this.getLower() && * value <= this.getUpper()} . */ default boolean includesValue( final long value) { return (value >= this.lower()) && (value <= this.upper()); }
/** * Fill a builder with attribute values from the provided {@code RangeInclusiveLType} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(RangeInclusiveLType instance) { Objects.requireNonNull(instance, "instance"); setLower(instance.lower()); setUpper(instance.upper()); return this; }
/** * <p> Determine if the given range is included in this range. </p> * * @param other The given range * * @return {@code true} iff {@code this.getLower() >= other.getLower() * && this.getUpper() <= other.getUpper()} . */ default boolean isIncludedIn( final RangeInclusiveL other) { Objects.requireNonNull(other, "Other range"); return (this.lower() >= (long) other.lower()) && (this.upper() <= (long) other.upper()); }