Package org.apache.sling.feature.extension.apiregions.api

# 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 final String`
`EXTENSION_NAME`
Extension name containing the deprecation.

## Method Summary

Modifier and Type
Method
Description
`void`
`addMemberInfo(String member, DeprecationInfo i)`
Add deprecation info for a member
`boolean`
`equals(Object obj)`
`static JDKDeprecationExtension`
`getExtension(org.apache.sling.feature.Extension ext)`
Get the execution environment from the extension.
`static JDKDeprecationExtension`
`getExtension(org.apache.sling.feature.Feature feature)`
Get the extension from the feature - if it exists.
`Map<String,DeprecationInfo>`
`getMemberInfos()`
Get all deprecation member infos
`int`
`hashCode()`
`void`
`removeMemberInfo(String member)`
Remove deprecation info for a member
`jakarta.json.JsonObject`
`toJSON()`
Generate a JSON representation

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### 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 Details

### 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 jakarta.json.JsonObject toJSON()
Generate a JSON representation

Returns:
  The JSON Object

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`