Package com.contentful.java.cma.model
Class CMALink
- java.lang.Object
-
- com.contentful.java.cma.model.CMAResource
-
- com.contentful.java.cma.model.CMALink
-
public class CMALink extends CMAResource
This class represents a link to another resource in Contentful.It contains a type and a linked type in its system property.
-
-
Constructor Summary
Constructors Constructor Description CMALink()Create a generic link.CMALink(CMAResource resource)Sets the target type and id from a given resource.CMALink(CMAType linkedType)Create a fully specified link, with type and linkedType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CMALinksetId(java.lang.String id)Set this ids value.CMALinksetSpaceId(java.lang.String spaceId)Set the id of the space this link.CMALinksetSystem(CMASystem system)Change ths system property to a new one.CMALinksetVersion(java.lang.Integer version)Change this instances version number.java.lang.StringtoString()-
Methods inherited from class com.contentful.java.cma.model.CMAResource
getEnvironmentId, getId, getSpaceId, getSystem, getVersion, getVisibility, isArchived, isPublished, setEnvironmentId, setVisibility
-
-
-
-
Constructor Detail
-
CMALink
public CMALink()
Create a generic link.Depending on the path you are uploading/changing this entry in, you might need to specify a
CMASystem.setLinkType(CMAType)to make this link fully functional.
-
CMALink
public CMALink(CMAType linkedType)
Create a fully specified link, with type and linkedType.- Parameters:
linkedType- the type this link links to.
-
CMALink
public CMALink(CMAResource resource)
Sets the target type and id from a given resource.- Parameters:
resource- to be linked to.
-
-
Method Detail
-
setSystem
public CMALink setSystem(CMASystem system)
Change ths system property to a new one.- Overrides:
setSystemin classCMAResource- Parameters:
system- the system property to be set.- Returns:
- this instance of a link for chaining.
-
setId
public CMALink setId(java.lang.String id)
Set this ids value.- Overrides:
setIdin classCMAResource- Parameters:
id- to be set.- Returns:
- This instance for chaining.
-
setVersion
public CMALink setVersion(java.lang.Integer version)
Change this instances version number.- Overrides:
setVersionin classCMAResource- Parameters:
version- the version number to be set.- Returns:
- this instance to be chained.
-
setSpaceId
public CMALink setSpaceId(java.lang.String spaceId)
Set the id of the space this link.- Overrides:
setSpaceIdin classCMAResource- Parameters:
spaceId- the id to be set.- Returns:
- this instance for ease of chaining.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classCMAResource- Returns:
- a human readable string, representing the object.
-
-