Class JDKDeprecationExtension


  • public class JDKDeprecationExtension
    extends Object
    Extension to hold information about deprecated JDK API This class is not thread safe.
    Since:
    1.1.0
    • Field Detail

      • EXTENSION_NAME

        public static final String EXTENSION_NAME
        Extension name containing the deprecation. The extension can be used to specify JDK API which is deprecated / should not be used. This extension is of type ExtensionType.JSON and is optional.
        See Also:
        Constant Field Values
    • Method Detail

      • getExtension

        public static JDKDeprecationExtension getExtension​(org.apache.sling.feature.Feature feature)
        Get the extension from the feature - if it exists.
        Parameters:
        feature - The feature
        Returns:
        The extension or null.
        Throws:
        IllegalArgumentException - If the extension is wrongly formatted
      • getExtension

        public static JDKDeprecationExtension getExtension​(org.apache.sling.feature.Extension ext)
        Get the execution environment from the extension.
        Parameters:
        ext - The extension
        Returns:
        The execution environment or null.
        Throws:
        IllegalArgumentException - If the extension is wrongly formatted
      • addMemberInfo

        public void addMemberInfo​(String member,
                                  DeprecationInfo i)
        Add deprecation info for a member
        Parameters:
        member - The member
        i - The info
        Throws:
        IllegalStateException - if the package is already deprecated
      • removeMemberInfo

        public void removeMemberInfo​(String member)
        Remove deprecation info for a member
        Parameters:
        member - The member
      • getMemberInfos

        public Map<String,​DeprecationInfo> getMemberInfos()
        Get all deprecation member infos
        Returns:
        The infos
      • toJSON

        public javax.json.JsonObject toJSON()
        Generate a JSON representation
        Returns:
        The JSON Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object