Class ArnResource

java.lang.Object
software.amazon.awssdk.arns.ArnResource
All Implemented Interfaces:
ToCopyableBuilder<ArnResource.Builder,ArnResource>

public final class ArnResource extends Object implements ToCopyableBuilder<ArnResource.Builder,ArnResource>
An additional model within Arn that provides the Resource Type, Resource, and Resource Qualifier of an AWS Arn when those values are present and correctly formatted within an Arn.

If resourceType is not present, resource will return the entire resource as a string the same as Arn.resource().

See Also:
  • Method Details

    • resourceType

      public Optional<String> resourceType()
      Returns:
      the optional resource type
    • resource

      public String resource()
      Returns:
      the entire resource as a string
    • qualifier

      public Optional<String> qualifier()
      Returns:
      the optional resource qualifier
    • 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 an ArnResource.

      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
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

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

      public ArnResource.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<ArnResource.Builder,ArnResource>
      Returns:
      a builder for type T