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>
An S3Resource that represents an S3 bucket.
  • Method Details

    • 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 interface S3Resource
      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 interface AwsResource
      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 interface AwsResource
      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 interface AwsResource
      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.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toBuilder

      public S3BucketResource.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<S3BucketResource.Builder,S3BucketResource>
      Returns:
      a builder for type T