public class ResourceBuilderFacade extends Object
Resource.Builder
that enforces Confluent conventions.Constructor and Description |
---|
ResourceBuilderFacade(String type) |
Modifier and Type | Method and Description |
---|---|
io.opencensus.proto.resource.v1.Resource |
build() |
ResourceBuilderFacade |
withId(String id) |
ResourceBuilderFacade |
withLabel(String key,
String value)
Add a label to this Resource.
|
ResourceBuilderFacade |
withLabelAliases(Map<String,String> labelAliases)
Add label aliases.
|
ResourceBuilderFacade |
withLabels(Map<String,String> labels)
Add labels to this Resource.
|
ResourceBuilderFacade |
withNamespacedLabel(String key,
String value)
Add a label to this Resource, prefixed with this Resource's type.
|
ResourceBuilderFacade |
withNamespacedLabels(Map<String,String> labels)
Add labels to this Resource, prefixed with this Resource's type.
|
ResourceBuilderFacade |
withVersion(String version) |
public ResourceBuilderFacade(String type)
public ResourceBuilderFacade withVersion(String version)
public ResourceBuilderFacade withId(String id)
public ResourceBuilderFacade withLabel(String key, String value)
public ResourceBuilderFacade withLabels(Map<String,String> labels)
public ResourceBuilderFacade withNamespacedLabel(String key, String value)
public ResourceBuilderFacade withNamespacedLabels(Map<String,String> labels)
public ResourceBuilderFacade withLabelAliases(Map<String,String> labelAliases)
When the Resource is built, any label with a configured alias will be included twice in the label map (once with the original label key and once with the alias key).
This is typically used to migrate a label from an old key to a new key while maintaining backwards compatibility during the deprecation period.
labelAliases
- A map of label → alias
public io.opencensus.proto.resource.v1.Resource build()