Package com.contentstack.sdk
Class AssetLibrary
java.lang.Object
com.contentstack.sdk.AssetLibrary
- All Implemented Interfaces:
INotifyClass
public class AssetLibrary extends Object implements INotifyClass
The type Asset library.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAssetLibrary.ORDERBYThe enum Orderby. -
Field Summary
Fields Modifier and Type Field Description protected FetchAssetsCallbackcallbackprotected intcountprotected LinkedHashMap<String,Object>headersprotected static Loggerloggerprotected StackstackInstanceprotected org.json.JSONObjecturlQueries -
Constructor Summary
Constructors Modifier Constructor Description protectedAssetLibrary() -
Method Summary
Modifier and Type Method Description voidfetchAll(FetchAssetsCallback callback)Fetch all.intgetCount()Gets count.voidgetResult(Object object, String controller)voidgetResultObject(List<Object> objects, org.json.JSONObject jsonObject, boolean isSingleEntry)AssetLibraryincludeCount()Include count asset library.AssetLibraryincludeFallback()Retrieve the published content of the fallback locale if an entry is not localized in specified localeAssetLibraryincludeRelativeUrl()Include relative url asset library.voidremoveHeader(String headerKey)Remove header.voidsetHeader(String headerKey, String headerValue)Sets header.protected voidsetStackInstance(Stack stack)AssetLibrarysort(String keyOrderBy, AssetLibrary.ORDERBY orderby)Sort asset library.
-
Field Details
-
logger
-
urlQueries
protected final org.json.JSONObject urlQueries -
stackInstance
-
headers
-
callback
-
count
protected int count
-
-
Constructor Details
-
AssetLibrary
protected AssetLibrary()
-
-
Method Details
-
setStackInstance
-
setHeader
Sets header.- Parameters:
headerKey- the header keyheaderValue- the header value
-
removeHeader
Remove header.- Parameters:
headerKey- the header key
-
sort
Sort asset library.- Parameters:
keyOrderBy- the key order byorderby- the orderby- Returns:
- the asset library
-
includeCount
Include count asset library.- Returns:
- the asset library
-
includeRelativeUrl
Include relative url asset library.- Returns:
- the asset library
-
includeFallback
Retrieve the published content of the fallback locale if an entry is not localized in specified locale- Returns:
AssetLibraryobject, so you can chain this call.
Example :
Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); AssetLibrary assetLibObject = stack.assetLibrary(); AssetLibrary.includeFallback();
-
getCount
public int getCount()Gets count.- Returns:
- the count
-
fetchAll
Fetch all.- Parameters:
callback- the callback
-
getResult
- Specified by:
getResultin interfaceINotifyClass
-
getResultObject
public void getResultObject(List<Object> objects, org.json.JSONObject jsonObject, boolean isSingleEntry)- Specified by:
getResultObjectin interfaceINotifyClass
-