Class DisplayData.ItemSpec<T>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.display.DisplayData.ItemSpec<T>
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- DisplayData
public abstract static class DisplayData.ItemSpec<T> extends java.lang.Object implements java.io.Serializable
Specifies anDisplayData.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 viaDisplayData.Builder.add(org.apache.beam.sdk.transforms.display.DisplayData.ItemSpec<?>)
withinHasDisplayData.populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder)
implementations.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ItemSpec()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.String
getKey()
The key for the display item.abstract @Nullable java.lang.String
getLabel()
The optional label for an item.abstract @Nullable java.lang.String
getLinkUrl()
The optional link URL for an item.abstract @Nullable java.lang.Class<?>
getNamespace()
The namespace for the display item.abstract @Nullable java.lang.Object
getShortValue()
The optional short value for an item, ornull
if none is provided.abstract DisplayData.Type
getType()
TheDisplayData.Type
of display data.abstract @Nullable java.lang.Object
getValue()
The value of the display item.java.lang.String
toString()
DisplayData.ItemSpec<T>
withLabel(@Nullable java.lang.String label)
Set the itemlabel
.DisplayData.ItemSpec<T>
withLinkUrl(@Nullable java.lang.String url)
Set the itemlink url
.DisplayData.ItemSpec<T>
withNamespace(java.lang.Class<?> namespace)
Set the itemnamespace
from the givenClass
.
-
-
-
Method Detail
-
getNamespace
public abstract @Nullable java.lang.Class<?> getNamespace()
The namespace for the display item. If unset, defaults to the component which the display item is registered to.
-
getKey
public abstract java.lang.String 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
public abstract DisplayData.Type getType()
TheDisplayData.Type
of display data. All display data conforms to a predefined set of allowed types.
-
getValue
public abstract @Nullable java.lang.Object 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
public abstract @Nullable java.lang.Object getShortValue()
The optional short value for an item, ornull
if none is provided.The short value is an alternative display representation for items having a long display value. For example, the
value
forDisplayData.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 thevalue
.
-
getLabel
public abstract @Nullable java.lang.String 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
public abstract @Nullable java.lang.String 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
public DisplayData.ItemSpec<T> withNamespace(java.lang.Class<?> namespace)
Set the itemnamespace
from the givenClass
.This method does not alter the current instance, but instead returns a new
DisplayData.ItemSpec
with the namespace set.
-
withLabel
public DisplayData.ItemSpec<T> withLabel(@Nullable java.lang.String label)
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.ItemSpec
with the label set.
-
withLinkUrl
public DisplayData.ItemSpec<T> withLinkUrl(@Nullable java.lang.String url)
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.ItemSpec
with the link url set.
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-