Class TextOverlayTransformation.Radius
-
- All Implemented Interfaces:
public final class TextOverlayTransformation.RadiusSpecifies the corner radius:
Single value (positive integer): Applied to all corners (e.g.,
20).max: Creates a circular or oval shape.Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
10_20_30_40). See Radius.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceTextOverlayTransformation.Radius.VisitorAn interface that defines how to map each variant of Radius to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<Double>number()final Optional<JsonValue>max()final Optional<String>string()final BooleanisNumber()final BooleanisMax()final BooleanisString()final DoubleasNumber()final JsonValueasMax()final StringasString()final Optional<JsonValue>_json()final <T extends Any> Taccept(TextOverlayTransformation.Radius.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final TextOverlayTransformation.Radiusvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static TextOverlayTransformation.RadiusofNumber(Double number)final static TextOverlayTransformation.RadiusofMax()final static TextOverlayTransformation.RadiusofString(String string)-
-
Method Detail
-
accept
final <T extends Any> T accept(TextOverlayTransformation.Radius.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import io.imagekit.core.JsonValue; import java.util.Optional; Optional<String> result = radius.accept(new Radius.Visitor<Optional<String>>() { @Override public Optional<String> visitNumber(Double number) { return Optional.of(number.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final TextOverlayTransformation.Radius validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofNumber
final static TextOverlayTransformation.Radius ofNumber(Double number)
-
ofMax
final static TextOverlayTransformation.Radius ofMax()
-
ofString
final static TextOverlayTransformation.Radius ofString(String string)
-
-
-
-