40 lines
1.0 KiB
Markdown
40 lines
1.0 KiB
Markdown
---
|
|
id: map
|
|
label: Map
|
|
title: Map - Transformation Services
|
|
type: transform
|
|
description: "Transforms the input by mapping it to another string. It expects the mappings to be read from a file which is stored under the `transform` folder."
|
|
since: 2x
|
|
install: auto
|
|
---
|
|
|
|
<!-- Attention authors: Do not edit directly. Please add your changes to the appropriate source repository -->
|
|
|
|
{% include base.html %}
|
|
|
|
# Map Transformation Service
|
|
|
|
Transforms the input by mapping it to another string. It expects the mappings to be read from a file which is stored under the `transform` folder.
|
|
|
|
This file should be in property syntax, i.e. simple lines with "key=value" pairs.
|
|
The file format is documented [here](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.Reader-).
|
|
To organize the various transformations one might use subfolders.
|
|
|
|
## Example
|
|
|
|
transform/binary.map:
|
|
|
|
```properties
|
|
key=value
|
|
1=ON
|
|
0=OFF
|
|
ON=1
|
|
OFF=0
|
|
```
|
|
|
|
| input | output |
|
|
|-------|---------|
|
|
| `1` | `ON` |
|
|
| `OFF` | `0` |
|
|
| `key` | `value` |
|