Class Region.Prefixed

java.lang.Object
com.jcabi.dynamo.Region.Prefixed
All Implemented Interfaces:
Region
Enclosing interface:
Region

@Immutable @Loggable(1) public static final class Region.Prefixed extends Object implements Region
All tables have a prefix in front of their names.

The region has to be used in combination with another region, for example Region.Simple:

Region region = new Region.Prefixed(
   new Region.Simple(creds),
   "foo-"
 );

Now, region.table("test") will return a Table instance pointing to the Dynamo DB table named "foo-test". Could be a convenient mechanism when you have many tables for different projects in the same region.

Since:
0.1
  • Constructor Details

    • Prefixed

      public Prefixed(Region region, String pfx)
      Public ctor.
      Parameters:
      region - Original region
      pfx - Prefix to add to all tables
  • Method Details

    • aws

      public software.amazon.awssdk.services.dynamodb.DynamoDbClient aws()
      Description copied from interface: Region
      Get DynamoDB client.
      Specified by:
      aws in interface Region
      Returns:
      The client
    • table

      public Table table(String name)
      Description copied from interface: Region
      Get one table.
      Specified by:
      table in interface Region
      Parameters:
      name - Table name
      Returns:
      Table