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

# Class Deprecation

java.lang.Object
org.apache.sling.feature.extension.apiregions.api.Deprecation

public class Deprecation extends Object
Deprecation state for a package Either the whole package is deprecated or some members. This class is not thread safe.

Since:
  1.1

## Constructor Summary

Constructors
Constructor
Description
`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 final String`
`getClassMemberName(String member)`
Returns the class member name part of a member string.
`static final String`
`getClassName(String member)`
Returns the class name part of a member string.
`Map<String,DeprecationInfo>`
`getMemberInfos()`
Get all deprecation member infos
`DeprecationInfo`
`getPackageInfo()`
Get the optional package info if the package is deprecated
`int`
`hashCode()`
`void`
`removeMemberInfo(String member)`
Remove deprecation info for a member
`void`
`setPackageInfo(DeprecationInfo i)`
Set the deprecation info for the whole package

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

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

## Constructor Details

### Deprecation

public Deprecation()

## Method Details

### getPackageInfo

public DeprecationInfo getPackageInfo()
Get the optional package info if the package is deprecated

Returns:
  The info or `null`

### setPackageInfo

public void setPackageInfo(DeprecationInfo i)
Set the deprecation info for the whole package

Parameters:
  `i` - The info
Throws:
  `IllegalStateException` - If a member is already deprecated

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

### getClassName

public static final String getClassName(String member)
Returns the class name part of a member string. This is the part before the first hash (or the full string if no hash)

Parameters:
  `member` - The member
Returns:
  The class name

### getClassMemberName

public static final String getClassMemberName(String member)
Returns the class member name part of a member string. This is the part after the first hash (or `null` if no hash

Parameters:
  `member` - The member
Returns:
  The class member name or `null`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`