public class ContentType extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
contentTypeName |
protected Stack |
stackInstance |
| Modifier | Constructor and Description |
|---|---|
protected |
ContentType(String contentTypeName) |
| Modifier and Type | Method and Description |
|---|---|
protected Entry |
entry() |
Entry |
entry(String entryUid)
Represents a
Entry. |
void |
fetch(org.json.JSONObject params,
ContentTypesCallback callback)
This call returns information of a specific content type.
|
Query |
query()
Represents a
Query. |
void |
removeHeader(String key)
Remove header key.
|
void |
setHeader(String key,
String value)
To set headers for Built.io Contentstack rest calls.
|
protected void |
setStackInstance(Stack stack) |
protected String contentTypeName
protected Stack stackInstance
protected ContentType(String contentTypeName)
protected void setStackInstance(Stack stack)
public void setHeader(String key, String value)
key - header name.value - header value against given header name.
//'blt5d4sample2633b' is a dummy Stack API key
//'blt6d0240b5sample254090d' is dummy access token.
Stack stack = Contentstack.stack("blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false);
ContentType contentType = stack.contentType("form_name");
contentType.setHeader("custom_key", "custom_value");
public void removeHeader(String key)
key - custom_header_key
//'blt5d4sample2633b' is a dummy Stack API key
//'blt6d0240b5sample254090d' is dummy access token.
Stack stack = Contentstack.stack( "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false);
ContentType contentType = stack.contentType("form_name");
contentType.removeHeader("custom_header_key");
public Entry entry(String entryUid)
entryUid - Set entry uid.Entry instance.
//'blt5d4sample2633b' is a dummy Stack API key
//'blt6d0240b5sample254090d' is dummy access token.
Stack stack = Contentstack.stack( "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false);
ContentType contentType = stack.contentType("form_name");
// setUid will identify the object, and calling save will update it
ENTRY entry = contentType.entry("bltf4fbbc94e8c851db");
protected Entry entry()
public Query query()
Query instance.
//'blt5d4sample2633b' is a dummy Stack API key
//'blt6d0240b5sample254090d' is dummy access token.
Stack stack = Contentstack.stack("blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false);
ContentType contentType = stack.contentType("form_name");
Query csQuery = contentType.query();
public void fetch(org.json.JSONObject params,
ContentTypesCallback callback)
params - query parameterscallback - ContentTypesCallback
ContentType contentType = stack.contentType("content_type_uid");
JSONObject params = new JSONObject();
params.put("include_snippet_schema", true);
params.put("limit", 3);
contentType.fetch(params, new ContentTypesCallback() {
public void onCompletion(ContentTypesModel contentTypesModel, Error error) {
if (error==null){
}else {
}
}
});
Copyright © 2021 Contentstack.. All rights reserved.