Skip to content

Commit 677457d

Browse files
committed
[fix #2]
renamed 'converter' to 'normalizer'
1 parent 715de8e commit 677457d

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

doc/configuration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The grouping notation (`{...}`) can also denote a function (written in [groovy](
1616
appropriate:
1717

1818
key {
19-
converter { value -> value.toUpperCase() }
19+
normalizer { value -> value.toUpperCase() }
2020
}
2121

2222
# Database View System of Record Configuration
@@ -33,10 +33,10 @@ group. A `fieldConfiguration` can have two fields (from three possible):
3333

3434
* value: String: name of the column from which to get the value
3535
* staticValue: String: a static value
36-
* converter: function: if not using a staticValue, the final value is the value returned from the function. The value
36+
* normalizer: function: if not using a staticValue, the final value is the value returned from the function. The value
3737
from the table cell is passed as an argument to the function. ex: `{ value -> value.toUpperCase() }`
3838

39-
Only one of `value` and `staticValue` can be used. `converter` is only used if `value` is used.
39+
Only one of `value` and `staticValue` can be used. `normalizer` is only used if `value` is used.
4040

4141
## Database View System of Record Configuration Items
4242
* configuration: group:
@@ -149,11 +149,11 @@ Only one of `value` and `staticValue` can be used. `converter` is only used if `
149149
}
150150
personStatus {
151151
value "termination_dt"
152-
converter { value -> value ? 'Inactive' : 'Active' }
152+
normalizer { value -> value ? 'Inactive' : 'Active' }
153153
}
154154
sorId {
155155
value "home_dept_cd"
156-
converter { value -> UUID.randomUUID().toString() }
156+
normalizer { value -> UUID.randomUUID().toString() }
157157
}
158158
}
159159
}

etc/openregistry/config/config.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ configuration {
3535
}
3636
personStatus {
3737
value "termination_dt"
38-
converter { value -> value ? 'Inactive' : 'Active' }
38+
normalizer { value -> value ? 'Inactive' : 'Active' }
3939
}
4040
sorId {
4141
value "home_dept_cd"
42-
converter { value -> UUID.randomUUID().toString() }
42+
normalizer { value -> UUID.randomUUID().toString() }
4343
}
4444
}
4545
}
@@ -82,11 +82,11 @@ configuration {
8282
}
8383
personStatus {
8484
value "termination_dt"
85-
converter { value -> value ? 'Inactive' : 'Active' }
85+
normalizer { value -> value ? 'Inactive' : 'Active' }
8686
}
8787
sorId {
8888
value "home_dept_cd"
89-
converter { value -> UUID.randomUUID().toString() }
89+
normalizer { value -> UUID.randomUUID().toString() }
9090
}
9191
}
9292
}

src/main/groovy/org/openregistry/loader/DatabaseViewSorConfigurationFactoryBean.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class DatabaseViewSorConfigurationFactoryBean implements FactoryBean<Map<String,
7777
PhonesDatabaseViewSorConfiguration.metaClass.methodMissing = notSoSimpleMethodMissing(null)
7878

7979
FieldConfiguration.metaClass.methodMissing = { name, args ->
80-
if (name in ['value', 'staticValue', 'converter']) {
80+
if (name in ['value', 'staticValue', 'normalizer']) {
8181
delegate."${name}" = args[0]
8282
}
8383
}

src/main/groovy/org/openregistry/loader/DatabaseViewSorPersonActionProcessor.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class DatabaseViewSorPersonActionProcessor extends PersonActionProcessor impleme
3636
return fieldConfig.staticValue
3737
}
3838
def value = row."${fieldConfig.value}"
39-
if (fieldConfig.converter) {
40-
value = fieldConfig.converter(value)
39+
if (fieldConfig.normalizer) {
40+
value = fieldConfig.normalizer(value)
4141
}
4242
return value
4343
}

src/main/groovy/org/openregistry/loader/SorConfiguration.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,5 @@ class PhonesConfiguration {
103103
class FieldConfiguration {
104104
def value
105105
def staticValue
106-
def converter
106+
def normalizer
107107
}

0 commit comments

Comments
 (0)