/** * Builds a new {@link RangeInclusiveL RangeInclusiveL}. * @return An immutable instance of RangeInclusiveL * @throws java.lang.IllegalStateException if any required attributes are missing */ public RangeInclusiveL build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return RangeInclusiveL.validate(new RangeInclusiveL(lower, 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; }
/** * Creates an immutable copy of a {@link RangeInclusiveLType} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable RangeInclusiveL instance */ public static RangeInclusiveL copyOf(RangeInclusiveLType instance) { if (instance instanceof RangeInclusiveL) { return (RangeInclusiveL) instance; } return RangeInclusiveL.builder() .from(instance) .build(); }
/** * Creates a builder for {@link RangeInclusiveL RangeInclusiveL}. * @return A new RangeInclusiveL builder */ public static RangeInclusiveL.Builder builder() { return new RangeInclusiveL.Builder(); }