Package software.amazon.awssdk.arns
Class ArnResource
- java.lang.Object
-
- software.amazon.awssdk.arns.ArnResource
-
- All Implemented Interfaces:
ToCopyableBuilder<ArnResource.Builder,ArnResource>
@SdkPublicApi public final class ArnResource extends Object implements ToCopyableBuilder<ArnResource.Builder,ArnResource>
An additional model withinArnthat provides the Resource Type, Resource, and Resource Qualifier of an AWS Arn when those values are present and correctly formatted within an Arn.If
resourceTypeis not present,resourcewill return the entire resource as a string the same asArn.resource().- See Also:
Arn
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceArnResource.Builderstatic classArnResource.DefaultBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ArnResource.Builderbuilder()booleanequals(Object o)static ArnResourcefromString(String resource)Parses a string containing either a resource, resource type and resource or resource type, resource and qualifier into anArnResource.inthashCode()Optional<String>qualifier()Stringresource()Optional<String>resourceType()ArnResource.BuildertoBuilder()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
resource
public String resource()
- Returns:
- the entire resource as a string
-
builder
public static ArnResource.Builder builder()
- Returns:
- a builder for
ArnResource.
-
fromString
public static ArnResource fromString(String resource)
Parses a string containing either a resource, resource type and resource or resource type, resource and qualifier into anArnResource.Supports fields separated by either ":" or "/".
For legacy AWS Arns not following the resourceType:resource:qualifier pattern, the qualifier field will contain everything after the first two sections separated by either ":" or "/".
- Parameters:
resource- - The resource string to parse.- Returns:
ArnResource
-
toBuilder
public ArnResource.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<ArnResource.Builder,ArnResource>
-
-