com.google.cloud.dataflow.sdk.transforms.display

## Class DisplayData

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.display.DisplayData

All Implemented Interfaces:
  Serializable

    public class DisplayData
    extends Object
    implements Serializable

Static display data associated with a pipeline component. Display data is useful for pipeline runner UIs and diagnostic dashboards to display details about `PTransforms` that make up a pipeline.

Components specify their display data by implementing the `HasDisplayData` interface.

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static interface` `DisplayData.Builder` Utility to build up display data from a component and its included subcomponents.
`static class` `DisplayData.Identifier` Unique identifier for a display data item within a component.
`static class` `DisplayData.Item<T>` `Items` are the unit of display data.
`static class` `DisplayData.Type` Display data type.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Map<DisplayData.Identifier,DisplayData.Item<?>>` `asMap()`
`boolean` `equals(Object obj)`
`static DisplayData` `from(HasDisplayData component)` Collect the `DisplayData` from a component.
`int` `hashCode()`
`static DisplayData.Type` `inferType(Object value)` Infer the `DisplayData.Type` for the given object.
`static DisplayData.Item<Boolean>` `item(String key, Boolean value)` Create a display item for the specified key and boolean value.
`static <T> DisplayData.Item<Class<T>>` `item(String key, Class<T> value)` Create a display item for the specified key and class value.
`static <T> DisplayData.Item<T>` `item(String key, DisplayData.Type type, T value)` Create a display item for the specified key, type, and value.
`static DisplayData.Item<Double>` `item(String key, Double value)` Create a display item for the specified key and floating point value.
`static DisplayData.Item<Duration>` `item(String key, Duration value)` Create a display item for the specified key and duration value.
`static DisplayData.Item<Float>` `item(String key, Float value)` Create a display item for the specified key and floating point value.
`static DisplayData.Item<Instant>` `item(String key, Instant value)` Create a display item for the specified key and timestamp value.
`static DisplayData.Item<Integer>` `item(String key, Integer value)` Create a display item for the specified key and integer value.
`static DisplayData.Item<Long>` `item(String key, Long value)` Create a display item for the specified key and integer value.
`static DisplayData.Item<String>` `item(String key, String value)` Create a display item for the specified key and string value.
`Collection<DisplayData.Item<?>>` `items()`
`static DisplayData` `none()` Default empty `DisplayData` instance.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Method Detail

#### none

    public static DisplayData none()

Default empty `DisplayData` instance.

#### from

    public static DisplayData from(HasDisplayData component)

Collect the `DisplayData` from a component. This will traverse all subcomponents specified via `DisplayData.Builder.include(com.google.cloud.dataflow.sdk.transforms.display.HasDisplayData)` in the given component. Data in this component will be in a namespace derived from the component.

#### inferType

    @Nullable
    public static DisplayData.Type inferType(@Nullable
                                                       Object value)

Infer the `DisplayData.Type` for the given object.

Use this method if the type of metadata is not known at compile time. For example:

     {@code

Returns:
  The inferred `DisplayData.Type`, or null if the type cannot be inferred,

#### items

    public Collection<DisplayData.Item<?>> items()

#### asMap

    public Map<DisplayData.Identifier,DisplayData.Item<?>> asMap()

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### item

    public static DisplayData.Item<String> item(String key,
                                                @Nullable
                                                String value)

Create a display item for the specified key and string value.

#### item

    public static DisplayData.Item<Integer> item(String key,
                                                 @Nullable
                                                 Integer value)

Create a display item for the specified key and integer value.

#### item

    public static DisplayData.Item<Long> item(String key,
                                              @Nullable
                                              Long value)

Create a display item for the specified key and integer value.

#### item

    public static DisplayData.Item<Float> item(String key,
                                               @Nullable
                                               Float value)

Create a display item for the specified key and floating point value.

#### item

    public static DisplayData.Item<Double> item(String key,
                                                @Nullable
                                                Double value)

Create a display item for the specified key and floating point value.

#### item

    public static DisplayData.Item<Boolean> item(String key,
                                                 @Nullable
                                                 Boolean value)

Create a display item for the specified key and boolean value.

#### item

    public static DisplayData.Item<Instant> item(String key,
                                                 @Nullable
                                                 Instant value)

Create a display item for the specified key and timestamp value.

#### item

    public static DisplayData.Item<Duration> item(String key,
                                                  @Nullable
                                                  Duration value)

Create a display item for the specified key and duration value.

#### item

    public static <T> DisplayData.Item<Class<T>> item(String key,
                                                      @Nullable
                                                      Class<T> value)

Create a display item for the specified key and class value.

#### item

    public static <T> DisplayData.Item<T> item(String key,
                                               DisplayData.Type type,
                                               @Nullable
                                               T value)

Create a display item for the specified key, type, and value. This method should be used if the type of the input value can only be determined at runtime. Otherwise, `HasDisplayData` implementors should call one of the typed factory methods, such as `item(String, String)` or `item(String, Integer)`.

Throws:
  `ClassCastException` - if the value cannot be formatted as the given type.
See Also:
  `inferType(Object)`