Class ResourceTag

  • All Implemented Interfaces:
    Serializable, SdkPojo, ToCopyableBuilder<ResourceTag.Builder,​ResourceTag>

    @Generated("software.amazon.awssdk:codegen")
    public final class ResourceTag
    extends Object
    implements SdkPojo, Serializable, ToCopyableBuilder<ResourceTag.Builder,​ResourceTag>

    The resource tags that Firewall Manager uses to determine if a particular resource should be included or excluded from the Firewall Manager policy. Tags enable you to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value. Firewall Manager combines the tags with "AND" so that, if you add more than one tag to a policy scope, a resource must have all the specified tags to be included or excluded. For more information, see Working with Tag Editor.

    Every resource tag must have a string value, either a non-empty string or an empty string. If you don't provide a value for a resource tag, Firewall Manager saves the value as an empty string: "". When Firewall Manager compares tags, it only matches two tags if they have the same key and the same value. A tag with an empty string value only matches with tags that also have an empty string value.

    See Also:
    Serialized Form
    • Method Detail

      • key

        public final String key()

        The resource tag key.

        Returns:
        The resource tag key.
      • value

        public final String value()

        The resource tag value. To specify an empty string value, either don't provide this or specify it as "".

        Returns:
        The resource tag value. To specify an empty string value, either don't provide this or specify it as "".
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)