public static final class DisplayData.Item<T> extends Object implements Serializable
Items are the unit of display data. Each item is identified by a given key
and namespace from the component the display item belongs to.
Items are registered via DisplayData.Builder.add(com.google.cloud.dataflow.sdk.transforms.display.DisplayData.Item<?>)
within HasDisplayData.populateDisplayData(com.google.cloud.dataflow.sdk.transforms.display.DisplayData.Builder) implementations.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getKey()
The key for the display item.
|
String |
getLabel()
Retrieve the optional label for an item.
|
String |
getLinkUrl()
Retrieve the optional link URL for an item.
|
String |
getNamespace()
The namespace for the display item.
|
Object |
getShortValue()
Return the optional short value for an item, or null if none is provided.
|
DisplayData.Type |
getType()
Retrieve the
DisplayData.Type of display data. |
Object |
getValue()
Retrieve the value of the display item.
|
int |
hashCode() |
String |
toString() |
DisplayData.Item<T> |
withLabel(String label)
Set the item
label. |
DisplayData.Item<T> |
withLinkUrl(String url)
Set the item
link url. |
DisplayData.Item<T> |
withNamespace(Class<?> namespace)
|
DisplayData.Item<T> |
withNamespace(String namespace) |
@Nullable public String getNamespace()
public String getKey()
public DisplayData.Type getType()
DisplayData.Type of display data. All metadata conforms to a
predefined set of allowed types.@Nullable public Object getValue()
DisplayData.item(java.lang.String, java.lang.String) into a format suitable for display. Translation is based on the
item's type.
The value will only be null if the input value during creation was null.
public Object getShortValue()
The short value is an alternative display representation for items having a long display
value. For example, the value for DisplayData.Type.JAVA_CLASS items contains
the full class name with package, while the short value contains just the class name.
A value will 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 the value.
@Nullable public String getLabel()
If no label was specified, this will return null.
@Nullable public String getLinkUrl()
If no URL was specified, this will return null.
public DisplayData.Item<T> withNamespace(Class<?> namespace)
namespace from the given Class.
This method does not alter the current instance, but instead returns a new DisplayData.Item
with the namespace set.
public DisplayData.Item<T> withNamespace(String namespace)
withNamespace(Class)public DisplayData.Item<T> withLabel(String label)
label.
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.Item
with the label set.
public DisplayData.Item<T> withLinkUrl(String url)
link 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.Item
with the link url set.