/** * Copy the current immutable object by setting a value for the {@link JCameraFPSStyleMouseRegionType#width() width} attribute. * A value strict bits equality used to prevent copying of the same value by returning {@code this}. * @param value A new value for width * @return A modified copy of the {@code this} object */ public final JCameraFPSStyleMouseRegion withWidth(double value) { if (Double.doubleToLongBits(this.width) == Double.doubleToLongBits(value)) return this; return validate(new JCameraFPSStyleMouseRegion(this, this.origin, value, this.height)); }
/** * Copy the current immutable object by setting a value for the {@link JCameraFPSStyleMouseRegionType#height() height} attribute. * A value strict bits equality used to prevent copying of the same value by returning {@code this}. * @param value A new value for height * @return A modified copy of the {@code this} object */ public final JCameraFPSStyleMouseRegion withHeight(double value) { if (Double.doubleToLongBits(this.height) == Double.doubleToLongBits(value)) return this; return validate(new JCameraFPSStyleMouseRegion(this, this.origin, this.width, value)); }
/** * Copy the current immutable object by setting a value for the {@link JCameraFPSStyleMouseRegionType#origin() origin} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for origin * @return A modified copy of the {@code this} object */ public final JCameraFPSStyleMouseRegion withOrigin(JCameraScreenOrigin value) { if (this.origin == value) return this; JCameraScreenOrigin newValue = Objects.requireNonNull(value, "origin"); return validate(new JCameraFPSStyleMouseRegion(this, newValue, this.width, this.height)); }
/** * Construct a new immutable {@code JCameraFPSStyleMouseRegion} instance. * @param origin The value for the {@code origin} attribute * @param width The value for the {@code width} attribute * @param height The value for the {@code height} attribute * @return An immutable JCameraFPSStyleMouseRegion instance */ public static JCameraFPSStyleMouseRegion of(JCameraScreenOrigin origin, double width, double height) { return validate(new JCameraFPSStyleMouseRegion(origin, width, height)); }