Class JDKDeprecationExtension
- java.lang.Object
-
- org.apache.sling.feature.extension.apiregions.api.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 Summary
Fields Modifier and Type Field Description static StringEXTENSION_NAMEExtension name containing the deprecation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMemberInfo(String member, DeprecationInfo i)Add deprecation info for a memberbooleanequals(Object obj)static JDKDeprecationExtensiongetExtension(org.apache.sling.feature.Extension ext)Get the execution environment from the extension.static JDKDeprecationExtensiongetExtension(org.apache.sling.feature.Feature feature)Get the extension from the feature - if it exists.Map<String,DeprecationInfo>getMemberInfos()Get all deprecation member infosinthashCode()voidremoveMemberInfo(String member)Remove deprecation info for a memberjakarta.json.JsonObjecttoJSON()Generate a JSON representation
-
-
-
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 typeExtensionType.JSONand 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 memberi- 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 jakarta.json.JsonObject toJSON()
Generate a JSON representation- Returns:
- The JSON Object
-
-