public interface HasMetadata extends KubernetesResource
KubernetesResource which possesses a ObjectMeta and is associated with a kind and API version.| Modifier and Type | Field and Description |
|---|---|
static String |
DNS_LABEL_END |
static String |
DNS_LABEL_REGEXP |
static String |
DNS_LABEL_START |
static Pattern |
FINALIZER_NAME_MATCHER
Pattern that checks the format of finalizer identifiers, which should be in
<domain name>/<finalizer name> format. |
| Modifier and Type | Method and Description |
|---|---|
default boolean |
addFinalizer(String finalizer)
Adds the specified finalizer to this
HasMetadata if it's valid. |
default String |
getApiVersion() |
static String |
getApiVersion(Class<? extends HasMetadata> clazz)
Computes the
apiVersion associated with this HasMetadata implementation. |
static String |
getGroup(Class<? extends HasMetadata> clazz)
Retrieves the group associated with the specified HasMetadata as defined by the
Group annotation. |
default String |
getKind() |
static String |
getKind(Class<? extends HasMetadata> clazz)
Retrieves the kind associated with the specified HasMetadata implementation.
|
ObjectMeta |
getMetadata() |
static String |
getVersion(Class<? extends HasMetadata> clazz)
Retrieves the version associated with the specified HasMetadata as defined by the
Version annotation. |
default boolean |
hasFinalizer(String finalizer)
Determines whether this
HasMetadata holds the specified finalizer. |
default boolean |
isFinalizerValid(String finalizer)
Determines whether the specified finalizer is valid according to the
finalizer specification.
|
default boolean |
isMarkedForDeletion()
Determines whether this
HasMetadata is marked for deletion or not. |
default boolean |
removeFinalizer(String finalizer)
Removes the specified finalizer if it's held by this
HasMetadata. |
void |
setApiVersion(String version) |
void |
setMetadata(ObjectMeta metadata) |
static final String DNS_LABEL_START
static final String DNS_LABEL_END
static final String DNS_LABEL_REGEXP
static final Pattern FINALIZER_NAME_MATCHER
<domain name>/<finalizer name> format.ObjectMeta getMetadata()
void setMetadata(ObjectMeta metadata)
static String getKind(Class<? extends HasMetadata> clazz)
Kind, the annotation value will be used, otherwise the value will be derived from the class name.clazz - the HasMetadata implementation whose Kind we want to retrievedefault String getKind()
static String getApiVersion(Class<? extends HasMetadata> clazz)
apiVersion associated with this HasMetadata implementation. The value is derived from the
Group and Version annotations.clazz - the HasMetadata whose apiVersion we want to computeapiVersion or null if neither Group or Version annotations are presentIllegalArgumentException - if only one of Group or Version is providedstatic String getGroup(Class<? extends HasMetadata> clazz)
Group annotation.clazz - the HasMetadata whose group we want to retrievenull if the HasMetadata is not annotated with Groupstatic String getVersion(Class<? extends HasMetadata> clazz)
Version annotation.clazz - the HasMetadata whose version we want to retrievenull if the HasMetadata is not annotated with Versiondefault String getApiVersion()
void setApiVersion(String version)
default boolean isMarkedForDeletion()
HasMetadata is marked for deletion or not.true if the cluster marked this HasMetadata for deletion, false otherwisedefault boolean hasFinalizer(String finalizer)
HasMetadata holds the specified finalizer.finalizer - the identifier of the finalizer we want to checktrue if this HasMetadata holds the specified finalizer, false otherwisedefault boolean addFinalizer(String finalizer)
HasMetadata if it's valid. See isFinalizerValid(String).finalizer - the identifier of the finalizer to add to this HasMetadata in <domain name>/<finalizer name> format.true if the finalizer was successfully added, false otherwise (in particular, if the object is marked for deletion)IllegalArgumentException - if the specified finalizer identifier is null or is invaliddefault boolean isFinalizerValid(String finalizer)
finalizer - the identifier of the finalizer which validity we want to checktrue if the identifier is valid, false otherwisedefault boolean removeFinalizer(String finalizer)
HasMetadata.finalizer - the identifier of the finalizer we want to removetrue if the finalizer was successfully removed, false otherwiseCopyright © 2015–2020 Red Hat. All rights reserved.