/** * Builds a new {@link RangeInclusiveB RangeInclusiveB}. * @return An immutable instance of RangeInclusiveB * @throws java.lang.IllegalStateException if any required attributes are missing */ public RangeInclusiveB build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return RangeInclusiveB.validate(new RangeInclusiveB(null, lower, upper)); }
/** * Fill a builder with attribute values from the provided {@code RangeInclusiveBType} 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(RangeInclusiveBType instance) { Objects.requireNonNull(instance, "instance"); setLower(instance.lower()); setUpper(instance.upper()); return this; }
/** * Creates an immutable copy of a {@link RangeInclusiveBType} 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 RangeInclusiveB instance */ public static RangeInclusiveB copyOf(RangeInclusiveBType instance) { if (instance instanceof RangeInclusiveB) { return (RangeInclusiveB) instance; } return RangeInclusiveB.builder() .from(instance) .build(); }
/** * Creates a builder for {@link RangeInclusiveB RangeInclusiveB}. * @return A new RangeInclusiveB builder */ public static RangeInclusiveB.Builder builder() { return new RangeInclusiveB.Builder(); }