Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
contentTypeName |
protected Stack |
stackInstance |
protected java.lang.String |
TAG |
Modifier | Constructor and Description |
---|---|
protected |
ContentType(java.lang.String contentTypeName) |
Modifier and Type | Method and Description |
---|---|
protected Entry |
entry() |
Entry |
entry(java.lang.String entryUid)
Represents a
Entry . |
void |
fetch(org.json.JSONObject params,
com.contentstack.sdk.ContentTypesCallback callback) |
Query |
query()
Represents a
Query . |
void |
removeHeader(java.lang.String key)
Remove header key.
|
void |
setHeader(java.lang.String key,
java.lang.String value)
To set headers for Built.io Contentstack rest calls.
|
protected void |
setStackInstance(Stack stack) |
protected java.lang.String TAG
protected java.lang.String contentTypeName
protected Stack stackInstance
protected void setStackInstance(Stack stack)
public void setHeader(java.lang.String key, java.lang.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(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); ContentType contentType = stack.contentType("form_name");
contentType.setHeader("custom_key", "custom_value");
public void removeHeader(java.lang.String key)
key
- custom_header_key
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); ContentType contentType = stack.contentType("form_name");
contentType.removeHeader("custom_header_key");
protected Entry entry()
public Entry entry(java.lang.String entryUid)
entryUid
- Set entry uid.Entry
instance.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "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");
public Query query()
Query
instance.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); ContentType contentType = stack.contentType("form_name");
Query csQuery = contentType.query();
public void fetch(org.json.JSONObject params, com.contentstack.sdk.ContentTypesCallback callback)
params
- query parameterscallback
- ContentTypesCallback
This call returns information of a specific content type. It returns the content type schema, but does not include its entries.
ContentType contentType = stack.contentType("content_type_uid"); JSONObject params = new JSONObject(); params.put("include_snippet_schema", true); params.put("limit", 3); contentType.fetch(new ContentTypesCallback() {