Class Target

    • Field Detail

      • targetType

        protected final TargetType targetType
    • Method Detail

      • targetForModelObject

        @Deprecated
        public static Target targetForModelObject​(Object modelObject)
        Deprecated.
        since 5.9
        Create a Target that points to a single model object, e.g. a Content.
        Parameters:
        modelObject - an API-layer model object (for example, a Content)
        Throws:
        IllegalArgumentException - if modelObject is an unsupported type
      • targetInContainer

        @Deprecated
        public static Target targetInContainer​(Container container,
                                               TargetType childTargetType)
        Deprecated.
        since 5.9
        Create a Target for a container being used to check operations on a different child TargetType within it.

        For example, a ContentType.PAGE container used to check operations on contained TargetType.COMMENTs.

        Parameters:
        container - an API-layer model object (for example, a Content) that is a container of other targets
        childTargetType - the TargetType (different from that of the container) whose permissions will be checked within the container
        Throws:
        IllegalArgumentException - if container is an unsupported type
      • forModelObject

        public static Target forModelObject​(Object modelObject)
        Create a Target that points to a single model object, e.g. a Content.
        Parameters:
        modelObject - an API-layer model object (for example, a Content)
        Throws:
        IllegalArgumentException - if modelObject is an unsupported type
      • forChildrenOfContainer

        public static Target forChildrenOfContainer​(Container container,
                                                    TargetType childTargetType)
        Create a Target for a container being used to check operations on a different child TargetType within it.

        For example, a ContentType.PAGE container used to check operations on contained TargetType.COMMENTs.

        Parameters:
        container - an API-layer model object (for example, a Content) that is a container of other targets
        childTargetType - the TargetType (different from that of the container) whose permissions will be checked within the container
        Throws:
        IllegalArgumentException - if container is an unsupported type
      • forContentId

        public static Target forContentId​(ContentId id,
                                          TargetType type)
        Create a Target from content id
        Parameters:
        id - id of content object
        Returns:
        target object
      • equals

        public boolean equals​(@Nullable Object o)
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object