Package org.cdk8s

Class ApiObjectMetadataDefinition

  • All Implemented Interfaces:
    software.amazon.jsii.JsiiSerializable

    @Generated(value="jsii-pacmak/1.106.0 (build e852934)",
               date="2024-12-31T06:16:49.781Z")
    @Stability(Stable)
    public class ApiObjectMetadataDefinition
    extends software.amazon.jsii.JsiiObject
    Object metadata.
    • Constructor Detail

      • ApiObjectMetadataDefinition

        protected ApiObjectMetadataDefinition​(software.amazon.jsii.JsiiObjectRef objRef)
      • ApiObjectMetadataDefinition

        protected ApiObjectMetadataDefinition​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
      • ApiObjectMetadataDefinition

        @Stability(Stable)
        public ApiObjectMetadataDefinition​(@NotNull
                                           ApiObjectMetadataDefinitionOptions options)
        Parameters:
        options - This parameter is required.
    • Method Detail

      • add

        @Stability(Stable)
        public void add​(@NotNull
                        String key,
                        @NotNull
                        Object value)
        Adds an arbitrary key/value to the object metadata.

        Parameters:
        key - Metadata key. This parameter is required.
        value - Metadata value. This parameter is required.
      • addAnnotation

        @Stability(Stable)
        public void addAnnotation​(@NotNull
                                  String key,
                                  @NotNull
                                  String value)
        Add an annotation.

        Parameters:
        key -
        • The key.
        This parameter is required.
        value -
        • The value.
        This parameter is required.
      • addFinalizers

        @Stability(Stable)
        public void addFinalizers​(@NotNull
                                  @NotNull String... finalizers)
        Add one or more finalizers.

        Parameters:
        finalizers - the finalizers. This parameter is required.
      • addLabel

        @Stability(Stable)
        public void addLabel​(@NotNull
                             String key,
                             @NotNull
                             String value)
        Add a label.

        Parameters:
        key -
        • The key.
        This parameter is required.
        value -
        • The value.
        This parameter is required.
      • addOwnerReference

        @Stability(Stable)
        public void addOwnerReference​(@NotNull
                                      OwnerReference owner)
        Add an owner.

        Parameters:
        owner - the owner. This parameter is required.
      • getLabel

        @Stability(Stable)
        @Nullable
        public String getLabel​(@NotNull
                               String key)
        Parameters:
        key - the label. This parameter is required.
        Returns:
        a value of a label or undefined
      • toJson

        @Stability(Stable)
        @NotNull
        public Object toJson()
        Synthesizes a k8s ObjectMeta for this metadata set.
      • getName

        @Stability(Stable)
        @Nullable
        public String getName()
        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.

      • getNamespace

        @Stability(Stable)
        @Nullable
        public String getNamespace()
        The object's namespace.