Class 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 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:
        setSystem in class CMAResource
        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:
        setId in class CMAResource
        Parameters:
        id - to be set.
        Returns:
        This instance for chaining.
      • setVersion

        public CMALink setVersion​(java.lang.Integer version)
        Change this instances version number.
        Overrides:
        setVersion in class CMAResource
        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:
        setSpaceId in class CMAResource
        Parameters:
        spaceId - the id to be set.
        Returns:
        this instance for ease of chaining.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class CMAResource
        Returns:
        a human readable string, representing the object.