Package io.imagekit.models
Class SolidColorOverlayTransformation.Gradient
-
- All Implemented Interfaces:
public final class SolidColorOverlayTransformation.GradientCreates a linear gradient with two colors. Pass
truefor a default gradient, or provide a string for a custom gradient. Only works if the base asset is an image. See gradient.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceSolidColorOverlayTransformation.Gradient.VisitorAn interface that defines how to map each variant of Gradient to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<JsonValue>true_()final Optional<String>string()final BooleanisTrue()final BooleanisString()final JsonValueasTrue()final StringasString()final Optional<JsonValue>_json()final <T extends Any> Taccept(SolidColorOverlayTransformation.Gradient.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final SolidColorOverlayTransformation.Gradientvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static SolidColorOverlayTransformation.GradientofTrue()final static SolidColorOverlayTransformation.GradientofString(String string)-
-
Method Detail
-
accept
final <T extends Any> T accept(SolidColorOverlayTransformation.Gradient.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 = gradient.accept(new Gradient.Visitor<Optional<String>>() { @Override public Optional<String> visitTrue(JsonValue true_) { return Optional.of(true_.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final SolidColorOverlayTransformation.Gradient 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.
-
ofTrue
final static SolidColorOverlayTransformation.Gradient ofTrue()
-
ofString
final static SolidColorOverlayTransformation.Gradient ofString(String string)
-
-
-
-