Class DisplayData.ItemSpec<T>
- All Implemented Interfaces:
Serializable
- Enclosing class:
DisplayData
DisplayData.Item to register as display data. Each item is identified by a given path,
key, and namespace from the component the display item belongs to.
Items are registered via DisplayData.Builder.add(org.apache.beam.sdk.transforms.display.DisplayData.ItemSpec<?>) within HasDisplayData.populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder) implementations.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringgetKey()The key for the display item.getLabel()The optional label for an item.The optional link URL for an item.The namespace for the display item.The optional short value for an item, ornullif none is provided.abstract DisplayData.TypegetType()TheDisplayData.Typeof display data.getValue()The value of the display item.final StringtoString()Set the itemlabel.withLinkUrl(@Nullable String url) Set the itemlink url.withNamespace(Class<?> namespace)
-
Constructor Details
-
ItemSpec
public ItemSpec()
-
-
Method Details
-
getNamespace
The namespace for the display item. If unset, defaults to the component which the display item is registered to. -
getKey
The key for the display item. Each display item is created with a key and value viaDisplayData.item(java.lang.String, java.lang.String). -
getType
TheDisplayData.Typeof display data. All display data conforms to a predefined set of allowed types. -
getValue
The value of the display item. The value is translated from the input toDisplayData.item(java.lang.String, java.lang.String)into a format suitable for display. Translation is based on the item'stype. -
getShortValue
The optional short value for an item, ornullif none is provided.The short value is an alternative display representation for items having a long display value. For example, the
valueforDisplayData.Type.JAVA_CLASSitems contains the full class name with package, while the short value contains just the class name.A
valuewill be provided for each display item, and some types may also provide a short-value. If a short value is provided, display data consumers may choose to display it instead of or in addition to thevalue. -
getLabel
The optional label for an item. The label is a human-readable description of what the metadata represents. UIs may choose to display the label instead of the item key. -
getLinkUrl
The optional link URL for an item. The URL points to an address where the reader can find additional context for the display data. -
withNamespace
Set the itemnamespacefrom the givenClass.This method does not alter the current instance, but instead returns a new
DisplayData.ItemSpecwith the namespace set. -
withLabel
Set the itemlabel.Specifying a null value will clear the label if it was previously defined.
This method does not alter the current instance, but instead returns a new
DisplayData.ItemSpecwith the label set. -
withLinkUrl
Set the itemlink url.Specifying a null value will clear the link url if it was previously defined.
This method does not alter the current instance, but instead returns a new
DisplayData.ItemSpecwith the link url set. -
toString
-