Package io.imagekit.models.assets
Class AssetListResponse
-
- All Implemented Interfaces:
public final class AssetListResponseObject containing details of a file or file version.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceAssetListResponse.VisitorAn interface that defines how to map each variant of AssetListResponse to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<File>file()Object containing details of a file or file version. final Optional<Folder>folder()final BooleanisFile()final BooleanisFolder()final FileasFile()Object containing details of a file or file version. final FolderasFolder()final Optional<JsonValue>_json()final <T extends Any> Taccept(AssetListResponse.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final AssetListResponsevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static AssetListResponseofFile(File file)Object containing details of a file or file version. final static AssetListResponseofFolder(Folder folder)-
-
Method Detail
-
accept
final <T extends Any> T accept(AssetListResponse.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 = assetListResponse.accept(new AssetListResponse.Visitor<Optional<String>>() { @Override public Optional<String> visitFile(File file) { return Optional.of(file.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final AssetListResponse 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.
-
ofFile
final static AssetListResponse ofFile(File file)
Object containing details of a file or file version.
-
ofFolder
final static AssetListResponse ofFolder(Folder folder)
-
-
-
-