public class ContentType
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
contentTypeName |
protected Stack |
stackInstance |
Modifier | Constructor and Description |
---|---|
protected |
ContentType(java.lang.String contentTypeName) |
Modifier and Type | Method and Description |
---|---|
protected com.contentstack.sdk.Entry |
entry() |
com.contentstack.sdk.Entry |
entry(java.lang.String entryUid)
Represents a
Entry . |
void |
fetch(org.json.JSONObject params,
com.contentstack.sdk.ContentTypesCallback callback)
This call returns information of a specific content type.
|
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 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("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( "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); ContentType contentType = stack.contentType("form_name");
contentType.removeHeader("custom_header_key");
public com.contentstack.sdk.Entry entry(java.lang.String entryUid)
Entry
.
Create Entry
instanceentryUid
- 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 com.contentstack.sdk.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, com.contentstack.sdk.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 { } } });