Skip to content

Commit eaf08c2

Browse files
committed
Drop unused methods. (94ae82a)
1 parent 253e25c commit eaf08c2

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

metafix/src/main/java/org/metafacture/metafix/api/FixFunction.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
import org.metafacture.metafix.Metafix;
2222
import org.metafacture.metafix.Record;
2323
import org.metafacture.metafix.Value;
24-
import org.metafacture.metafix.maps.RdfMap;
25-
import org.metafacture.metamorph.api.Maps;
2624

27-
import java.io.File;
28-
import java.util.Arrays;
2925
import java.util.HashSet;
3026
import java.util.List;
3127
import java.util.Map;
@@ -111,32 +107,4 @@ default Stream<Value> flatten(final Stream<Value> stream) {
111107
));
112108
}
113109

114-
default void lookup(final Metafix metafix, final Record record, final List<String> params, final Map<String, String> options, final FixFunction mapFunction) {
115-
final Map<String, String> map = getMap(metafix, record, params, options, mapFunction);
116-
record.transform(params.get(0), oldValue -> {
117-
final String newValue = map.getOrDefault(oldValue, map.get(Maps.DEFAULT_MAP_KEY));
118-
return newValue != null ? newValue : getBoolean(options, "delete") ? null : oldValue;
119-
});
120-
}
121-
122-
static Map<String, String> getMap(final Metafix metafix, final Record record, final List<String> params, final Map<String, String> options, final FixFunction mapFunction) {
123-
final Map<String, String> map;
124-
if (params.size() <= 1) {
125-
map = options;
126-
}
127-
else {
128-
final String mapName = mapFunction.toString().equals("put_rdfmap") ? (params.size() > 1 ? params.get(1) : params.get(0)) + options.get(RdfMap.TARGET) + options.getOrDefault(RdfMap.TARGET_LANGUAGE, "") : params.get(1);
129-
if (!metafix.getMapNames().contains(mapName)) {
130-
if (mapName.contains(".") || mapName.contains(File.separator)) {
131-
mapFunction.apply(metafix, record, Arrays.asList(mapName), options);
132-
}
133-
else {
134-
// Probably an unknown internal map? Log a warning?
135-
}
136-
}
137-
map = metafix.getMap(mapName);
138-
}
139-
return map;
140-
}
141-
142110
}

0 commit comments

Comments
 (0)