Package org.cdk8s.plus24
Class PersistentVolumeClaimProps.Builder
- java.lang.Object
-
- org.cdk8s.plus24.PersistentVolumeClaimProps.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<PersistentVolumeClaimProps>
- Enclosing interface:
- PersistentVolumeClaimProps
@Stability(Stable) public static final class PersistentVolumeClaimProps.Builder extends Object implements software.amazon.jsii.Builder<PersistentVolumeClaimProps>
A builder forPersistentVolumeClaimProps
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PersistentVolumeClaimProps.Builder
accessModes(List<? extends PersistentVolumeAccessMode> accessModes)
Sets the value ofPersistentVolumeClaimProps.getAccessModes()
PersistentVolumeClaimProps
build()
Builds the configured instance.PersistentVolumeClaimProps.Builder
metadata(org.cdk8s.ApiObjectMetadata metadata)
Sets the value ofResourceProps.getMetadata()
PersistentVolumeClaimProps.Builder
storage(org.cdk8s.Size storage)
Sets the value ofPersistentVolumeClaimProps.getStorage()
PersistentVolumeClaimProps.Builder
storageClassName(String storageClassName)
Sets the value ofPersistentVolumeClaimProps.getStorageClassName()
PersistentVolumeClaimProps.Builder
volume(IPersistentVolume volume)
Sets the value ofPersistentVolumeClaimProps.getVolume()
PersistentVolumeClaimProps.Builder
volumeMode(PersistentVolumeMode volumeMode)
Sets the value ofPersistentVolumeClaimProps.getVolumeMode()
-
-
-
Method Detail
-
accessModes
@Stability(Stable) public PersistentVolumeClaimProps.Builder accessModes(List<? extends PersistentVolumeAccessMode> accessModes)
Sets the value ofPersistentVolumeClaimProps.getAccessModes()
- Parameters:
accessModes
- Contains the access modes the volume should support.- Returns:
this
-
storage
@Stability(Stable) public PersistentVolumeClaimProps.Builder storage(org.cdk8s.Size storage)
Sets the value ofPersistentVolumeClaimProps.getStorage()
- Parameters:
storage
- Minimum storage size the volume should have.- Returns:
this
-
storageClassName
@Stability(Stable) public PersistentVolumeClaimProps.Builder storageClassName(String storageClassName)
Sets the value ofPersistentVolumeClaimProps.getStorageClassName()
- Parameters:
storageClassName
- Name of the StorageClass required by the claim. When this property is not set, the behavior is as follows:.- If the admission plugin is turned on, the storage class marked as default will be used.
- If the admission plugin is turned off, the pvc can only be bound to volumes without a storage class.
- Returns:
this
-
volume
@Stability(Stable) public PersistentVolumeClaimProps.Builder volume(IPersistentVolume volume)
Sets the value ofPersistentVolumeClaimProps.getVolume()
- Parameters:
volume
- The PersistentVolume backing this claim. The control plane still checks that storage class, access modes, and requested storage size on the volume are valid.Note that in order to guarantee a proper binding, the volume should also define a
claimRef
referring to this claim. Otherwise, the volume may be claimed be other pvc's before it gets a chance to bind to this one.If the volume is managed (i.e not imported), you can use
pv.claim()
to easily create a bi-directional bounded claim.- Returns:
this
-
volumeMode
@Stability(Stable) public PersistentVolumeClaimProps.Builder volumeMode(PersistentVolumeMode volumeMode)
Sets the value ofPersistentVolumeClaimProps.getVolumeMode()
- Parameters:
volumeMode
- Defines what type of volume is required by the claim.- Returns:
this
-
metadata
@Stability(Stable) public PersistentVolumeClaimProps.Builder metadata(org.cdk8s.ApiObjectMetadata metadata)
Sets the value ofResourceProps.getMetadata()
- Parameters:
metadata
- Metadata that all persisted resources must have, which includes all objects users must create.- Returns:
this
-
build
@Stability(Stable) public PersistentVolumeClaimProps build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PersistentVolumeClaimProps>
- Returns:
- a new instance of
PersistentVolumeClaimProps
- Throws:
NullPointerException
- if any required attribute was not provided
-
-