S - the class providing the Spec part of this CustomResourceT - the class providing the Status part of this CustomResourcepublic abstract class CustomResource<S,T> extends Object implements io.fabric8.kubernetes.api.model.HasMetadata
Group and Version.
Properties are set up automatically as follows:
HasMetadata.getGroup(Class)HasMetadata.getVersion(Class)getSingular(Class)getPlural(Class)getCRDName(Class)setApiVersion(String) and setKind(String) are overridden to not do anything since these values
are set.| Modifier and Type | Field and Description |
|---|---|
static String |
CLUSTER_SCOPE |
static String |
NAMESPACE_SCOPE |
protected S |
spec |
protected T |
status |
| Constructor and Description |
|---|
CustomResource() |
| Modifier and Type | Method and Description |
|---|---|
String |
getApiVersion() |
String |
getCRDName() |
static String |
getCRDName(Class<? extends CustomResource> clazz)
Computes the name of the Custom Resource Definition (CRD) associated with the specified CustomResource.
|
String |
getGroup() |
String |
getKind() |
io.fabric8.kubernetes.api.model.ObjectMeta |
getMetadata() |
String |
getPlural() |
static String |
getPlural(Class<? extends io.fabric8.kubernetes.api.model.HasMetadata> clazz)
Retrieves the plural form associated with the specified CustomResource if annotated with
Plural or computes a default value
using the value returned by getSingular(Class) as input to Pluralize.toPlural(String). |
String |
getScope()
Retrieves the scope that this CustomResource targets
|
static boolean |
getServed(Class<? extends CustomResource> clazz) |
String |
getSingular() |
static String |
getSingular(Class<? extends io.fabric8.kubernetes.api.model.HasMetadata> clazz)
Retrieves the singular form associated with the specified CustomResource as defined by the
Singular annotation or
computes a default value (lower-cased version of the value returned by HasMetadata.getKind(Class)) if the annotation
is not present. |
S |
getSpec() |
T |
getStatus() |
static boolean |
getStorage(Class<? extends CustomResource> clazz) |
String |
getVersion() |
protected S |
initSpec()
Override to provide your own Spec instance
|
protected T |
initStatus()
Override to provide your own Status instance
|
boolean |
isServed() |
boolean |
isStorage() |
void |
setApiVersion(String version) |
void |
setKind(String kind) |
void |
setMetadata(io.fabric8.kubernetes.api.model.ObjectMeta metadata) |
void |
setSpec(S spec) |
void |
setStatus(T status) |
String |
toString() |
public static final String NAMESPACE_SCOPE
public static final String CLUSTER_SCOPE
protected S spec
protected T status
public static boolean getServed(Class<? extends CustomResource> clazz)
public static boolean getStorage(Class<? extends CustomResource> clazz)
protected S initSpec()
protected T initStatus()
public String getApiVersion()
getApiVersion in interface io.fabric8.kubernetes.api.model.HasMetadatapublic void setApiVersion(String version)
setApiVersion in interface io.fabric8.kubernetes.api.model.HasMetadatapublic String getKind()
getKind in interface io.fabric8.kubernetes.api.model.HasMetadatapublic void setKind(String kind)
public io.fabric8.kubernetes.api.model.ObjectMeta getMetadata()
getMetadata in interface io.fabric8.kubernetes.api.model.HasMetadatapublic void setMetadata(io.fabric8.kubernetes.api.model.ObjectMeta metadata)
setMetadata in interface io.fabric8.kubernetes.api.model.HasMetadatapublic static String getPlural(Class<? extends io.fabric8.kubernetes.api.model.HasMetadata> clazz)
Plural or computes a default value
using the value returned by getSingular(Class) as input to Pluralize.toPlural(String).clazz - the CustomResource whose plural form we want to retrievePlural annotation or a computed default valuepublic String getPlural()
public static String getSingular(Class<? extends io.fabric8.kubernetes.api.model.HasMetadata> clazz)
Singular annotation or
computes a default value (lower-cased version of the value returned by HasMetadata.getKind(Class)) if the annotation
is not present.clazz - the CustomResource whose singular form we want to retrieveSingular annotation or a computed default valuepublic String getSingular()
public static String getCRDName(Class<? extends CustomResource> clazz)
clazz - the CustomResource whose CRD name we want to computepublic String getCRDName()
public String getScope()
CLUSTER_SCOPE or NAMESPACE_SCOPE.public String getGroup()
public String getVersion()
public boolean isServed()
public boolean isStorage()
public S getSpec()
public void setSpec(S spec)
public T getStatus()
public void setStatus(T status)
Copyright © 2015–2021 Red Hat. All rights reserved.