public final class Arn extends Object implements ToCopyableBuilder<Arn.Builder,Arn>
The primary supported Arn format is:
arn:<partition>:<service>:<region>:<account>:<resource>
resourceAsString() returns everything after the account section of the Arn
as a single string.
However, the following Arn formats are supported where the values are present and well
formatted through resource():
arn:<partition>:<service>:<region>:<account>:<resourcetype>/resource arn:<partition>:<service>:<region>:<account>:<resourcetype>/resource/qualifier arn:<partition>:<service>:<region>:<account>:<resourcetype>/resource:qualifier arn:<partition>:<service>:<region>:<account>:<resourcetype>:resource arn:<partition>:<service>:<region>:<account>:<resourcetype>:resource:qualifier
resource() returns a ArnResource which has access
to ArnResource.resourceType(), ArnResource.resource() and
ArnResource.qualifier().
To parse an Arn from a string use Arn.fromString(). To convert an Arn to it's string representation use Arn.toString().
For instance, for a string s, containing a well-formed Arn the following should always be true:
Arn theArn = Arn.fromString(s); s.equals(theArn.toString());
ArnResource| Modifier and Type | Class and Description |
|---|---|
static interface |
Arn.Builder
A builder for a
Arn. |
| Modifier and Type | Method and Description |
|---|---|
Optional<String> |
accountId() |
static Arn.Builder |
builder() |
boolean |
equals(Object o) |
static Arn |
fromString(String arn)
Parses a given string into an
Arn. |
int |
hashCode() |
String |
partition() |
Optional<String> |
region() |
ArnResource |
resource() |
String |
resourceAsString() |
String |
service() |
Arn.Builder |
toBuilder() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcopypublic String partition()
public String service()
public Optional<String> accountId()
public ArnResource resource()
ArnResourcepublic String resourceAsString()
public static Arn.Builder builder()
Arn.public static Arn fromString(String arn)
Arn. The resource is accessible entirely as a
string through resourceAsString(). Where correctly formatted, a parsed
resource containing resource type, resource and qualifier is available through
resource().arn - - A string containing an Arn.Arn - A modeled Arn.public Arn.Builder toBuilder()
toBuilder in interface ToCopyableBuilder<Arn.Builder,Arn>Copyright © 2023. All rights reserved.