Class UrlEndpointResponse.UrlRewriter
-
- All Implemented Interfaces:
public final class UrlEndpointResponse.UrlRewriterConfiguration for third-party URL rewriting.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceUrlEndpointResponse.UrlRewriter.VisitorAn interface that defines how to map each variant of UrlRewriter to a value of type T.
public final classUrlEndpointResponse.UrlRewriter.Cloudinary
-
Method Summary
-
-
Method Detail
-
cloudinary
final Optional<UrlEndpointResponse.UrlRewriter.Cloudinary> cloudinary()
-
isCloudinary
final Boolean isCloudinary()
-
asCloudinary
final UrlEndpointResponse.UrlRewriter.Cloudinary asCloudinary()
-
accept
final <T extends Any> T accept(UrlEndpointResponse.UrlRewriter.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 = urlRewriter.accept(new UrlRewriter.Visitor<Optional<String>>() { @Override public Optional<String> visitCloudinary(Cloudinary cloudinary) { return Optional.of(cloudinary.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final UrlEndpointResponse.UrlRewriter 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.
-
ofCloudinary
final static UrlEndpointResponse.UrlRewriter ofCloudinary(UrlEndpointResponse.UrlRewriter.Cloudinary cloudinary)
-
ofImgix
final static UrlEndpointResponse.UrlRewriter ofImgix()
-
ofAkamai
final static UrlEndpointResponse.UrlRewriter ofAkamai()
-
-
-
-