Class OverlayPosition.YCenter
-
- All Implemented Interfaces:
public final class OverlayPosition.YCenterSpecifies the y-coordinate on the base asset where the overlay's center will be positioned. It also accepts arithmetic expressions such as
bh_mul_0.4orbh_sub_ch. Maps tolycin the URL. Cannot be used together withy, but can be used withx. Learn about Arithmetic expressions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceOverlayPosition.YCenter.VisitorAn interface that defines how to map each variant of YCenter to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<Double>number()final Optional<String>string()final BooleanisNumber()final BooleanisString()final DoubleasNumber()final StringasString()final Optional<JsonValue>_json()final <T extends Any> Taccept(OverlayPosition.YCenter.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final OverlayPosition.YCentervalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static OverlayPosition.YCenterofNumber(Double number)final static OverlayPosition.YCenterofString(String string)-
-
Method Detail
-
accept
final <T extends Any> T accept(OverlayPosition.YCenter.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 = yCenter.accept(new YCenter.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 OverlayPosition.YCenter 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 OverlayPosition.YCenter ofNumber(Double number)
-
ofString
final static OverlayPosition.YCenter ofString(String string)
-
-
-
-