new Union(listDefOrBaseTag [, transformers])
Creates an instance of the Union
transformer which will merge the specified ListDef
, or instance, into an
the ListDef
this transformer is applied to.
If an instance is being merged, then an optional set of transformers can be provided.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
listDefOrBaseTag |
olympe.dc.ListDef | string | olympe.df.OString | olympe.df.Proxy | The |
|
transformers |
Array.<olympe.dc.Transformer> |
<optional> <nullable> |
An optional set of transformers. Ignored if previous argument is a |
- Implements:
Methods
-
getBaseTag()
-
Returns the basetag of the query that this "unified" by this transformer to the parent query
Returns:
- Type
- string | olympe.df.OString | olympe.df.Proxy
-
getName()
-
Gets this
Transformer
unique name.- Implements:
Returns:
The name.
- Type
- string
-
getTransform(manager, stateResolver, callback)
-
Get the transformer's transform function. This is the method that implementations of
Transformer
must provide and is where the actual transformation will take place.Parameters:
Name Type Description manager
olympe.dc.Manager The DC manager.
stateResolver
olympe.dc.ranking.StateResolver The state resolver.
callback
olympe.dc.Manager.TransformationCallback The callback.
- Implements:
Returns:
The transform function.
-
getTransformers()
-
Returns the array of transformer (i.e. the query) that is "unified" by this transformer to the parent query
Returns:
- Type
- Array.<olympe.dc.Transformer>
-
getValueType()
-
Gets the transformed item's value type. A
null
value means that the transformer will not change the type of the values (e.g. a sort transformer).- Implements:
Returns:
Returns the transformed listDef value new type or
null
if this transformer does not change it- Type
- function
-
serialize(parameters)
-
Serializes the transformer.
Parameters:
Name Type Description parameters
olympe.dc.query.Parameters The parameters for the serialization.
- Implements:
Throws:
-
If the transformer is not serializable.
- Type
- Error
Returns:
The JSON representation.
- Type
- string
-
toString()
-
Gets a string representation of the transformer.
- Implements:
Returns:
The representation.
- Type
- string