@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)",
date="2022-08-17T17:31:08.663Z")
public class Size
extends software.amazon.jsii.JsiiObject
The amount can be specified either as a literal value (e.g: 10
) which
cannot be negative, or as an unresolved number token.
When the amount is passed as a token, unit conversion is not possible.
Example:
Bucket bucket; // Provide a Lambda function that will transform records before delivery, with custom // buffering and retry configuration Function lambdaFunction = Function.Builder.create(this, "Processor") .runtime(Runtime.NODEJS_12_X) .handler("index.handler") .code(Code.fromAsset(join(__dirname, "process-records"))) .build(); LambdaFunctionProcessor lambdaProcessor = LambdaFunctionProcessor.Builder.create(lambdaFunction) .bufferInterval(Duration.minutes(5)) .bufferSize(Size.mebibytes(5)) .retries(5) .build(); S3Bucket s3Destination = S3Bucket.Builder.create(bucket) .processor(lambdaProcessor) .build(); DeliveryStream.Builder.create(this, "Delivery Stream") .destinations(List.of(s3Destination)) .build();
Modifier | Constructor and Description |
---|---|
protected |
Size(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Size(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static Size |
gibibytes(java.lang.Number amount)
Create a Storage representing an amount gibibytes.
|
java.lang.Boolean |
isUnresolved()
Checks if size is a token or a resolvable object.
|
static Size |
kibibytes(java.lang.Number amount)
Create a Storage representing an amount kibibytes.
|
static Size |
mebibytes(java.lang.Number amount)
Create a Storage representing an amount mebibytes.
|
static Size |
pebibyte(java.lang.Number amount)
Deprecated.
use `pebibytes` instead
|
static Size |
pebibytes(java.lang.Number amount)
Create a Storage representing an amount pebibytes.
|
static Size |
tebibytes(java.lang.Number amount)
Create a Storage representing an amount tebibytes.
|
java.lang.Number |
toGibibytes()
Return this storage as a total number of gibibytes.
|
java.lang.Number |
toGibibytes(SizeConversionOptions opts)
Return this storage as a total number of gibibytes.
|
java.lang.Number |
toKibibytes()
Return this storage as a total number of kibibytes.
|
java.lang.Number |
toKibibytes(SizeConversionOptions opts)
Return this storage as a total number of kibibytes.
|
java.lang.Number |
toMebibytes()
Return this storage as a total number of mebibytes.
|
java.lang.Number |
toMebibytes(SizeConversionOptions opts)
Return this storage as a total number of mebibytes.
|
java.lang.Number |
toPebibytes()
Return this storage as a total number of pebibytes.
|
java.lang.Number |
toPebibytes(SizeConversionOptions opts)
Return this storage as a total number of pebibytes.
|
java.lang.Number |
toTebibytes()
Return this storage as a total number of tebibytes.
|
java.lang.Number |
toTebibytes(SizeConversionOptions opts)
Return this storage as a total number of tebibytes.
|
protected Size(software.amazon.jsii.JsiiObjectRef objRef)
protected Size(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public static Size gibibytes(java.lang.Number amount)
1 GiB = 1024 MiB
amount
- the amount of gibibytes to be represented. This parameter is required.public static Size kibibytes(java.lang.Number amount)
1 KiB = 1024 bytes
amount
- the amount of kibibytes to be represented. This parameter is required.public static Size mebibytes(java.lang.Number amount)
1 MiB = 1024 KiB
amount
- the amount of mebibytes to be represented. This parameter is required.@Deprecated public static Size pebibyte(java.lang.Number amount)
1 PiB = 1024 TiB
amount
- This parameter is required.public static Size pebibytes(java.lang.Number amount)
1 PiB = 1024 TiB
amount
- the amount of pebibytes to be represented. This parameter is required.public static Size tebibytes(java.lang.Number amount)
1 TiB = 1024 GiB
amount
- the amount of tebibytes to be represented. This parameter is required.public java.lang.Boolean isUnresolved()
public java.lang.Number toGibibytes(SizeConversionOptions opts)
opts
- the conversion options.public java.lang.Number toGibibytes()
public java.lang.Number toKibibytes(SizeConversionOptions opts)
opts
- the conversion options.public java.lang.Number toKibibytes()
public java.lang.Number toMebibytes(SizeConversionOptions opts)
opts
- the conversion options.public java.lang.Number toMebibytes()
public java.lang.Number toPebibytes(SizeConversionOptions opts)
opts
- the conversion options.public java.lang.Number toPebibytes()
public java.lang.Number toTebibytes(SizeConversionOptions opts)
opts
- the conversion options.public java.lang.Number toTebibytes()