@FunctionalInterface public interface Transformer
Transformer is a routine that takes a key/value pair and
potentially alters one or both of them, prior to import.
Sometimes, raw data from a source must be modified before being imported into Concourse, for example:
| Modifier and Type | Method and Description |
|---|---|
KeyValue<String,Object> |
transform(String key,
String value)
Potentially transform one or both of the
key/value pair. |
@Nullable KeyValue<String,Object> transform(String key, String value)
key/value pair.
If no transformation should occur, it is acceptable to return
null to inform the caller that the import values are fine.
Otherwise, the preferred pair should be wrapped in a KeyValue
object.key - the raw key to potentially transformvalue - the raw value to potentially transform; in which case, it is
acceptable to return any kind of object, but it is recommended
to return an encoded String (i.e. don't return a
Link object, but return a
string that encodes a link (@record@) instead)KeyValue object that contains the transformed
key/value pair or null if no
transformation occurred