Class CloudObject
java.lang.Object
java.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.json.GenericJson
org.apache.beam.runners.dataflow.util.CloudObject
A representation of an arbitrary Java object to be instantiated by Dataflow workers.
Typically, an object to be written by the SDK to the Dataflow service will implement a method
(typically called asCloudObject()
) that returns a CloudObject
to represent the
object in the protocol. Once the CloudObject
is constructed, the method should explicitly
add additional properties to be presented during deserialization, representing child objects by
building additional CloudObject
s.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
static CloudObject
forBoolean
(Boolean value) Constructs aCloudObject
representing the given value.static CloudObject
Constructs aCloudObject
to be used for serializing an instance of the supplied class for transport via the Dataflow API.static CloudObject
forClassName
(String className) Constructs aCloudObject
to be used for serializing data to be deserialized using the supplied class name the supplied class name for transport via the Dataflow API.static CloudObject
Constructs aCloudObject
representing the given value.static CloudObject
Constructs aCloudObject
representing the given value.static CloudObject
forInteger
(Integer value) Constructs aCloudObject
representing the given value.static CloudObject
forInteger
(Long value) Constructs aCloudObject
representing the given value.static CloudObject
forKnownType
(Object value) Constructs aCloudObject
representing the given value of a well-known cloud object type.static CloudObject
Constructs aCloudObject
representing the given value.static CloudObject
Constructs aCloudObject
by copying the supplied serialized object spec, which must represent an SDK object serialized for transport via the Dataflow API.Gets the name of the Java class that this CloudObject represents.int
hashCode()
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, set, setFactory, toPrettyString, toString
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
fromSpec
Constructs aCloudObject
by copying the supplied serialized object spec, which must represent an SDK object serialized for transport via the Dataflow API.The most common use of this method is during deserialization on the worker, where it's used as a binding type during instance construction.
- Parameters:
spec
- supplies the serialized form of the object as a nested map- Throws:
RuntimeException
- if the supplied map does not represent an SDK object
-
forClass
Constructs aCloudObject
to be used for serializing an instance of the supplied class for transport via the Dataflow API. The instance parameters to be serialized must be supplied explicitly after theCloudObject
is created, by usingGenericData.put(java.lang.String, java.lang.Object)
.- Parameters:
cls
- the class to use when deserializing the object on the worker
-
forClassName
Constructs aCloudObject
to be used for serializing data to be deserialized using the supplied class name the supplied class name for transport via the Dataflow API. The instance parameters to be serialized must be supplied explicitly after theCloudObject
is created, by usingGenericData.put(java.lang.String, java.lang.Object)
.- Parameters:
className
- the class to use when deserializing the object on the worker
-
forString
Constructs aCloudObject
representing the given value.- Parameters:
value
- the scalar value to represent.
-
forBoolean
Constructs aCloudObject
representing the given value.- Parameters:
value
- the scalar value to represent.
-
forInteger
Constructs aCloudObject
representing the given value.- Parameters:
value
- the scalar value to represent.
-
forInteger
Constructs aCloudObject
representing the given value.- Parameters:
value
- the scalar value to represent.
-
forFloat
Constructs aCloudObject
representing the given value.- Parameters:
value
- the scalar value to represent.
-
forFloat
Constructs aCloudObject
representing the given value.- Parameters:
value
- the scalar value to represent.
-
forKnownType
Constructs aCloudObject
representing the given value of a well-known cloud object type.- Parameters:
value
- the scalar value to represent.- Throws:
RuntimeException
- if the value does not have aCloudKnownType
mapping
-
getClassName
Gets the name of the Java class that this CloudObject represents. -
clone
- Overrides:
clone
in classcom.google.api.client.json.GenericJson
-
equals
-
hashCode
public int hashCode()
-