com.adobe.cq.social.badging.api.UserBadge Maven / Gradle / Ivy
/**************************************************************************
*
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 2016 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/
package com.adobe.cq.social.badging.api;
import javax.annotation.Nonnull;
import org.apache.sling.api.resource.Resource;
/**
* A user's earned/assigned badge info containing the path to the badge content (resource for the image, title, etc.)
* and whether it's an assigned badge.
*/
public interface UserBadge {
/**
* Returns the absolute path to the badge image, e.g. the path to the png image. Can return an empty string if
* image can't be found or it no longer exist (e.g. resource removed from /libs/community/badging/images).
* @return absolute path to the badge image resource.
*/
@Deprecated
@Nonnull
String getImagePath();
/**
* @return the {@link BadgingService#BADGE_PATH_PROP} property or empty string if it doesn't exist.
*/
@Nonnull
String getBadgePath();
/**
* @return true if badge is an assigned badge.
*/
boolean isAssigned();
/**
* The earned or assigned badge user generated content resource. For example, resources in
* /content/usergenerated/asi/srp/{user's profile path}/badges. Not to be confused with a badge content resource,
* such as the resources in /libs/community/badging/images.
* @return the resource of the badge.
*/
@Nonnull
Resource getResource();
}