TagManager
TagManager facilitates a common implementation of tagging for Constructs.
Initializers
import com.aliyun.ros.cdk.core.TagManager;
TagManager.Builder.create(TagType tagType, java.lang.String resourceTypeName, java.lang.Object tagStructure)
// .tagPropertyName(java.lang.String)
.build();
Name | Type | Description |
---|---|---|
tagType |
TagType |
No description. |
resourceTypeName |
java.lang.String |
No description. |
tagStructure |
java.lang.Object |
No description. |
tagPropertyName |
java.lang.String |
The name of the property in ROS for these tags. |
tagType
Required
- Type: TagType
resourceTypeName
Required
- Type: java.lang.String
tagStructure
Optional
- Type: java.lang.Object
tagPropertyName
Optional
- Type: java.lang.String
- Default: "tags"
The name of the property in ROS for these tags.
Normally this is tags
, but Cognito UserPool uses UserPoolTags
Methods
Name | Description |
---|---|
applyTagAspectHere |
Determine if the aspect applies here. |
hasTags |
Returns true if there are any tags defined. |
removeTag |
Removes the specified tag from the array if it exists. |
renderTags |
Renders tags into the proper format based on TagType. |
setTag |
Adds the specified tag to the array of tags. |
tagValues |
Render the tags in a readable format. |
applyTagAspectHere
public java.lang.Boolean applyTagAspectHere()
public java.lang.Boolean applyTagAspectHere(java.util.List<java.lang.String> include)
public java.lang.Boolean applyTagAspectHere(java.util.List<java.lang.String> include, java.util.List<java.lang.String> exclude)
Determine if the aspect applies here.
Looks at the include and exclude resourceTypeName arrays to determine if the aspect applies here
- Type: java.util.List
- Type: java.util.List
hasTags
public java.lang.Boolean hasTags()
Returns true if there are any tags defined.
removeTag
public void removeTag(java.lang.String key, java.lang.Number priority)
Removes the specified tag from the array if it exists.
- Type: java.lang.String
The tag to remove.
- Type: java.lang.Number
The priority of the remove operation.
renderTags
public java.lang.Object renderTags()
Renders tags into the proper format based on TagType.
setTag
public void setTag(java.lang.String key, java.lang.String value)
public void setTag(java.lang.String key, java.lang.String value, java.lang.Number priority)
public void setTag(java.lang.String key, java.lang.String value, java.lang.Number priority, java.lang.Boolean applyToLaunchedInstances)
Adds the specified tag to the array of tags.
- Type: java.lang.String
- Type: java.lang.String
- Type: java.lang.Number
applyToLaunchedInstances
Optional
- Type: java.lang.Boolean
tagValues
public java.util.Map<java.lang.String, java.lang.String> tagValues()
Render the tags in a readable format.
Static Functions
Name | Description |
---|---|
isTaggable |
Check whether the given construct is Taggable. |
isTaggable
import com.aliyun.ros.cdk.core.TagManager;
TagManager.isTaggable(java.lang.Object construct)
Check whether the given construct is Taggable.
- Type: java.lang.Object
Properties
Name | Type | Description |
---|---|---|
tagPropertyName |
java.lang.String |
The property name for tag values. |
tagPropertyName
Required
public java.lang.String getTagPropertyName();
- Type: java.lang.String
The property name for tag values.
Normally this is tags
but some resources choose a different name. Cognito
UserPool uses UserPoolTags