Class S3BucketResource
- java.lang.Object
-
- software.amazon.awssdk.services.s3.internal.resource.S3BucketResource
-
- All Implemented Interfaces:
AwsResource
,S3Resource
,ToCopyableBuilder<S3BucketResource.Builder,S3BucketResource>
public final class S3BucketResource extends Object implements S3Resource, ToCopyableBuilder<S3BucketResource.Builder,S3BucketResource>
AnS3Resource
that represents an S3 bucket.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
S3BucketResource.Builder
A builder forS3BucketResource
objects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
accountId()
Gets the AWS account ID associated with this bucket if one has been specified.String
bucketName()
Gets the name of the bucket.static S3BucketResource.Builder
builder()
Get a new builder for this class.boolean
equals(Object o)
int
hashCode()
Optional<String>
partition()
Gets the AWS partition name associated with this bucket (e.g.: 'aws') if one has been specified.Optional<String>
region()
Gets the AWS region name associated with this bucket (e.g.: 'us-east-1') if one has been specified.S3BucketResource.Builder
toBuilder()
String
type()
Gets the resource type for this bucket.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.services.s3.internal.resource.S3Resource
overrideSigner, parentS3Resource
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
builder
public static S3BucketResource.Builder builder()
Get a new builder for this class.- Returns:
- A newly initialized instance of a builder.
-
type
public String type()
Gets the resource type for this bucket.- Specified by:
type
in interfaceS3Resource
- Returns:
- This will always return "bucket_name".
-
partition
public Optional<String> partition()
Gets the AWS partition name associated with this bucket (e.g.: 'aws') if one has been specified.- Specified by:
partition
in interfaceAwsResource
- Returns:
- the optional name of the partition or empty if it has not been specified.
-
region
public Optional<String> region()
Gets the AWS region name associated with this bucket (e.g.: 'us-east-1') if one has been specified.- Specified by:
region
in interfaceAwsResource
- Returns:
- the optional name of the region or empty if the region has not been specified (e.g. the resource is in the global namespace).
-
accountId
public Optional<String> accountId()
Gets the AWS account ID associated with this bucket if one has been specified.- Specified by:
accountId
in interfaceAwsResource
- Returns:
- the optional AWS account ID or empty if the account ID has not been specified.
-
bucketName
public String bucketName()
Gets the name of the bucket.- Returns:
- the name of the bucket.
-
toBuilder
public S3BucketResource.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<S3BucketResource.Builder,S3BucketResource>
-
-