Package com.contentful.java.cma.model
Class CMAResource
- java.lang.Object
-
- com.contentful.java.cma.model.CMAResource
-
- Direct Known Subclasses:
CMAApiKey,CMAArray,CMAAsset,CMABulkAction,CMAContentType,CMAEditorInterface,CMAEntry,CMAEnvironment,CMAError,CMALink,CMALocale,CMAOrganization,CMAPersonalAccessToken,CMAPreviewApiKey,CMARole,CMAScheduledAction,CMASnapshot,CMASpace,CMASpaceMembership,CMATag,CMAUiExtension,CMAUpload,CMAUsage,CMAUser,CMAWebhook,CMAWebhookCall,CMAWebhookCallDetail,CMAWebhookHealth
public class CMAResource extends java.lang.ObjectBase CMA resource. All `things` you will be retrieving and sending from and to Contentful will be based on this class.
-
-
Constructor Summary
Constructors Constructor Description CMAResource(CMAType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetEnvironmentId()java.lang.StringgetId()java.lang.StringgetSpaceId()CMASystemgetSystem()java.lang.IntegergetVersion()CMAVisibilitygetVisibility()java.lang.BooleanisArchived()java.lang.BooleanisPublished()<T extends CMAResource>
TsetEnvironmentId(java.lang.String environmentId)Convenience method for setting an environment id.<T extends CMAResource>
TsetId(java.lang.String id)Sets the ID for this CMAResource.<T extends CMAResource>
TsetSpaceId(java.lang.String spaceId)Convenience method for setting a space id.<T extends CMAResource>
TsetSystem(CMASystem system)Sets the system field.<T extends CMAResource>
TsetVersion(java.lang.Integer version)Convenience method for setting a version.<T extends CMAResource>
TsetVisibility(CMAVisibility visibility)Convenience method for setting a version.java.lang.StringtoString()
-
-
-
Constructor Detail
-
CMAResource
public CMAResource(CMAType type)
-
-
Method Detail
-
getSystem
public CMASystem getSystem()
- Returns:
- the system field.
-
setSystem
public <T extends CMAResource> T setSystem(CMASystem system)
Sets the system field.- Type Parameters:
T- resource type to be returned.- Parameters:
system- sets the system property.- Returns:
- this, as casted to a resource, for the ease of chaining.
-
getId
public java.lang.String getId()
- Returns:
- the
sys.idvalue, null if it is does not exist.
-
setId
public <T extends CMAResource> T setId(java.lang.String id)
Sets the ID for this CMAResource.- Type Parameters:
T- resource type to be returned.- Parameters:
id- to be set.- Returns:
- this
CMAResourceinstance.
-
getVersion
public java.lang.Integer getVersion()
- Returns:
- the
sys.versionvalue, null if it does not exist.
-
getVisibility
public CMAVisibility getVisibility()
- Returns:
- the
sys.visibilityvalue, null if it does not exist.
-
setVersion
public <T extends CMAResource> T setVersion(java.lang.Integer version)
Convenience method for setting a version.- Type Parameters:
T- the type of the CMAResource calling.- Parameters:
version- the version number to be set.- Returns:
- the calling
CMAResourcefor chaining.
-
setVisibility
public <T extends CMAResource> T setVisibility(CMAVisibility visibility)
Convenience method for setting a version.- Parameters:
visibility- the visibility to be set.- Returns:
- the calling
CMAResourcefor chaining.
-
getSpaceId
public java.lang.String getSpaceId()
- Returns:
- the ID of the Space associated with this resource, null if it does not exist.
-
setSpaceId
public <T extends CMAResource> T setSpaceId(java.lang.String spaceId)
Convenience method for setting a space id.- Type Parameters:
T- An implementation of CMAResource, normally used for chaining setter methods.- Parameters:
spaceId- the id to be set.- Returns:
- the calling
CMAResourcefor chaining.
-
getEnvironmentId
public java.lang.String getEnvironmentId()
- Returns:
- the ID of the Environment associated with this resource,
Constants.DEFAULT_ENVIRONMENTif it does not exist.
-
setEnvironmentId
public <T extends CMAResource> T setEnvironmentId(java.lang.String environmentId)
Convenience method for setting an environment id.- Type Parameters:
T- An implementation of CMAResource, normally used for chaining setter methods.- Parameters:
environmentId- the id to be set.- Returns:
- the calling
CMAResourcefor chaining.
-
isArchived
public java.lang.Boolean isArchived()
- Returns:
- true if this resource is archived.
-
isPublished
public java.lang.Boolean isPublished()
- Returns:
- true if this resource is published.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a human readable string, representing the object.
-
-