public final class DeprecationData extends Object
Notifying users about deprecated items: Some code that uses this class may choose
to proactively notify users (e.g. with a log message) when the deprecated item is used. The
isNotificationUseful()
method should be checked before emitting any such notification.
Notifying the user should only be done if the user can take some action in response. Advising that
something will be removed in a later release is not useful if there is no alternative in the
current release. If the isNotificationUseful()
method returns true
the text
description of the deprecated item available from the relevant read-XXX-description
management operation should provide useful information about how the user can avoid using
the deprecated item.
Constructor and Description |
---|
DeprecationData(ModelVersion since)
Creates a new DeprecationData which will return
false from isNotificationUseful() . |
DeprecationData(ModelVersion since,
boolean notificationUseful)
Creates a new DeprecationData, with an option to disable notifications to users when
the use the deprecated item.
|
Modifier and Type | Method and Description |
---|---|
ModelVersion |
getSince()
Gets the version since which the attribute has been deprecated.
|
boolean |
isNotificationUseful()
Gets whether actively advising the user about the deprecation is useful.
|
public DeprecationData(ModelVersion since)
false
from isNotificationUseful()
.since
- the version since which the attribute has been deprecated. Cannot be null
public DeprecationData(ModelVersion since, boolean notificationUseful)
since
- the version since which the attribute has been deprecated. Cannot be null
notificationUseful
- whether actively advising the user about the deprecation is usefulpublic ModelVersion getSince()
public boolean isNotificationUseful()
true
if advising the user is usefulCopyright © 2020 JBoss by Red Hat. All rights reserved.