Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.cdk8s.ApiObjectMetadataDefinition Maven / Gradle / Ivy
Go to download
This is the core library of Cloud Development Kit (CDK) for Kubernetes (cdk8s). cdk8s apps synthesize into standard Kubernetes manifests which can be applied to any Kubernetes cluster.
package org.cdk8s;
/**
* Object metadata.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.106.0 (build e852934)", date = "2024-12-18T12:15:47.110Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = org.cdk8s.$Module.class, fqn = "cdk8s.ApiObjectMetadataDefinition")
public class ApiObjectMetadataDefinition extends software.amazon.jsii.JsiiObject {
protected ApiObjectMetadataDefinition(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected ApiObjectMetadataDefinition(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param options This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public ApiObjectMetadataDefinition(final @org.jetbrains.annotations.NotNull org.cdk8s.ApiObjectMetadataDefinitionOptions options) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(options, "options is required") });
}
/**
* Adds an arbitrary key/value to the object metadata.
*
* @param key Metadata key. This parameter is required.
* @param value Metadata value. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void add(final @org.jetbrains.annotations.NotNull java.lang.String key, final @org.jetbrains.annotations.NotNull java.lang.Object value) {
software.amazon.jsii.Kernel.call(this, "add", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(key, "key is required"), value });
}
/**
* Add an annotation.
*
* @param key
This parameter is required.
* @param value This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void addAnnotation(final @org.jetbrains.annotations.NotNull java.lang.String key, final @org.jetbrains.annotations.NotNull java.lang.String value) {
software.amazon.jsii.Kernel.call(this, "addAnnotation", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(key, "key is required"), java.util.Objects.requireNonNull(value, "value is required") });
}
/**
* Add one or more finalizers.
*
* @param finalizers the finalizers. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void addFinalizers(final @org.jetbrains.annotations.NotNull java.lang.String... finalizers) {
software.amazon.jsii.Kernel.call(this, "addFinalizers", software.amazon.jsii.NativeType.VOID, java.util.Arrays.stream(finalizers).toArray(Object[]::new));
}
/**
* Add a label.
*
* @param key
This parameter is required.
* @param value This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void addLabel(final @org.jetbrains.annotations.NotNull java.lang.String key, final @org.jetbrains.annotations.NotNull java.lang.String value) {
software.amazon.jsii.Kernel.call(this, "addLabel", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(key, "key is required"), java.util.Objects.requireNonNull(value, "value is required") });
}
/**
* Add an owner.
*
* @param owner the owner. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void addOwnerReference(final @org.jetbrains.annotations.NotNull org.cdk8s.OwnerReference owner) {
software.amazon.jsii.Kernel.call(this, "addOwnerReference", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(owner, "owner is required") });
}
/**
* @return a value of a label or undefined
* @param key the label. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.Nullable java.lang.String getLabel(final @org.jetbrains.annotations.NotNull java.lang.String key) {
return software.amazon.jsii.Kernel.call(this, "getLabel", software.amazon.jsii.NativeType.forClass(java.lang.String.class), new Object[] { java.util.Objects.requireNonNull(key, "key is required") });
}
/**
* Synthesizes a k8s ObjectMeta for this metadata set.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.Object toJson() {
return software.amazon.jsii.Kernel.call(this, "toJson", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
}
/**
* The name of the API object.
*
* If a name is specified in metadata.name
this will be the name returned.
* Otherwise, a name will be generated by calling
* Chart.of(this).generatedObjectName(this)
, which by default uses the
* construct path to generate a DNS-compatible name for the resource.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.Nullable java.lang.String getName() {
return software.amazon.jsii.Kernel.get(this, "name", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* The object's namespace.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.Nullable java.lang.String getNamespace() {
return software.amazon.jsii.Kernel.get(this, "namespace", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* A fluent builder for {@link org.cdk8s.ApiObjectMetadataDefinition}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create() {
return new Builder();
}
private final org.cdk8s.ApiObjectMetadataDefinitionOptions.Builder options;
private Builder() {
this.options = new org.cdk8s.ApiObjectMetadataDefinitionOptions.Builder();
}
/**
* Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata.
*
* They are not queryable and should be
* preserved when modifying objects.
*
* Default: - No annotations.
*
* @return {@code this}
* @see http://kubernetes.io/docs/user-guide/annotations
* @param annotations Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder annotations(final java.util.Map annotations) {
this.options.annotations(annotations);
return this;
}
/**
* Namespaced keys that tell Kubernetes to wait until specific conditions are met before it fully deletes resources marked for deletion.
*
* Must be empty before the object is deleted from the registry. Each entry is
* an identifier for the responsible component that will remove the entry from
* the list. If the deletionTimestamp of the object is non-nil, entries in
* this list can only be removed. Finalizers may be processed and removed in
* any order. Order is NOT enforced because it introduces significant risk of
* stuck finalizers. finalizers is a shared field, any actor with permission
* can reorder it. If the finalizer list is processed in order, then this can
* lead to a situation in which the component responsible for the first
* finalizer in the list is waiting for a signal (field value, external
* system, or other) produced by a component responsible for a finalizer later
* in the list, resulting in a deadlock. Without enforced ordering finalizers
* are free to order amongst themselves and are not vulnerable to ordering
* changes in the list.
*
* Default: - No finalizers.
*
* @return {@code this}
* @see https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/
* @param finalizers Namespaced keys that tell Kubernetes to wait until specific conditions are met before it fully deletes resources marked for deletion. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder finalizers(final java.util.List finalizers) {
this.options.finalizers(finalizers);
return this;
}
/**
* Map of string keys and values that can be used to organize and categorize (scope and select) objects.
*
* May match selectors of replication controllers and services.
*
* Default: - No labels.
*
* @return {@code this}
* @see http://kubernetes.io/docs/user-guide/labels
* @param labels Map of string keys and values that can be used to organize and categorize (scope and select) objects. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder labels(final java.util.Map labels) {
this.options.labels(labels);
return this;
}
/**
* The unique, namespace-global, name of this object inside the Kubernetes cluster.
*
* Normally, you shouldn't specify names for objects and let the CDK generate
* a name for you that is application-unique. The names CDK generates are
* composed from the construct path components, separated by dots and a suffix
* that is based on a hash of the entire path, to ensure uniqueness.
*
* You can supply custom name allocation logic by overriding the
* chart.generateObjectName
method.
*
* If you use an explicit name here, bear in mind that this reduces the
* composability of your construct because it won't be possible to include
* more than one instance in any app. Therefore it is highly recommended to
* leave this unspecified.
*
* Default: - an app-unique name generated by the chart
*
* @return {@code this}
* @param name The unique, namespace-global, name of this object inside the Kubernetes cluster. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder name(final java.lang.String name) {
this.options.name(name);
return this;
}
/**
* Namespace defines the space within each name must be unique.
*
* An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation.
* Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
*
* Default: undefined (will be assigned to the 'default' namespace)
*
* @return {@code this}
* @param namespace Namespace defines the space within each name must be unique. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder namespace(final java.lang.String namespace) {
this.options.namespace(namespace);
return this;
}
/**
* List of objects depended by this object.
*
* If ALL objects in the list have
* been deleted, this object will be garbage collected. If this object is
* managed by a controller, then an entry in this list will point to this
* controller, with the controller field set to true. There cannot be more
* than one managing controller.
*
* Kubernetes sets the value of this field automatically for objects that are
* dependents of other objects like ReplicaSets, DaemonSets, Deployments, Jobs
* and CronJobs, and ReplicationControllers. You can also configure these
* relationships manually by changing the value of this field. However, you
* usually don't need to and can allow Kubernetes to automatically manage the
* relationships.
*
* Default: - automatically set by Kubernetes
*
* @return {@code this}
* @see https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/
* @param ownerReferences List of objects depended by this object. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ownerReferences(final java.util.List extends org.cdk8s.OwnerReference> ownerReferences) {
this.options.ownerReferences(ownerReferences);
return this;
}
/**
* Which ApiObject instance is the metadata attached to.
*
* @return {@code this}
* @param apiObject Which ApiObject instance is the metadata attached to. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder apiObject(final org.cdk8s.ApiObject apiObject) {
this.options.apiObject(apiObject);
return this;
}
/**
* @return a newly built instance of {@link org.cdk8s.ApiObjectMetadataDefinition}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public org.cdk8s.ApiObjectMetadataDefinition build() {
return new org.cdk8s.ApiObjectMetadataDefinition(
this.options.build()
);
}
}
}