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(ContentTypesCallback callback) |
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(context, "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(context, "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(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");
protected Entry entry()
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(ContentTypesCallback callback)
callback - 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");
contentType.fetch(new ContentTypesCallback() {Copyright © 2019 Contentstack. All rights reserved.