Package org.cdk8s.plus20
Class PersistentVolumeClaimProps.Builder
- java.lang.Object
-
- org.cdk8s.plus20.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.BuilderaccessModes(List<? extends PersistentVolumeAccessMode> accessModes)Sets the value ofPersistentVolumeClaimProps.getAccessModes()PersistentVolumeClaimPropsbuild()Builds the configured instance.PersistentVolumeClaimProps.Buildermetadata(org.cdk8s.ApiObjectMetadata metadata)Sets the value ofResourceProps.getMetadata()PersistentVolumeClaimProps.Builderstorage(org.cdk8s.Size storage)Sets the value ofPersistentVolumeClaimProps.getStorage()PersistentVolumeClaimProps.BuilderstorageClassName(String storageClassName)Sets the value ofPersistentVolumeClaimProps.getStorageClassName()PersistentVolumeClaimProps.Buildervolume(IPersistentVolume volume)Sets the value ofPersistentVolumeClaimProps.getVolume()PersistentVolumeClaimProps.BuildervolumeMode(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
claimRefreferring 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:
buildin interfacesoftware.amazon.jsii.Builder<PersistentVolumeClaimProps>- Returns:
- a new instance of
PersistentVolumeClaimProps - Throws:
NullPointerException- if any required attribute was not provided
-
-