Skip to content

Commit

Permalink
TableIOOptions: Parser of type Function<String, ?> instead of Functio…
Browse files Browse the repository at this point in the history
…n<String, Object>
  • Loading branch information
frauzufall authored and imagejan committed Aug 13, 2020
1 parent a05eb1f commit e45f633
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/scijava/table/io/ColumnTableIOOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ColumnTableIOOptions formatter(Function<Object, String> formatter) {
return setValue(formatterKey, formatter);
}

ColumnTableIOOptions parser(Function<String, Object> parser) {
ColumnTableIOOptions parser(Function<String, ?> parser) {
return setValue(parserKey, parser);
}

Expand All @@ -57,7 +57,7 @@ public Function<Object, String> formatter() {
return getValueOrDefault(formatterKey, String::valueOf);
}

public Function<String, Object> parser() {
public Function<String, ?> parser() {
return getValueOrDefault(parserKey, String::valueOf);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/scijava/table/io/TableIOOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public TableIOOptions guessParser(boolean guessParser) {
/**
* @param parser Parser to use when converting table entries into data objects.
*/
public TableIOOptions parser(Function<String, Object> parser) {
public TableIOOptions parser(Function<String, ?> parser) {
guessParser(false);
return setValue(parserKey, parser);
}
Expand Down Expand Up @@ -188,7 +188,7 @@ public TableIOOptions columnFormatter(int column, Function<Object, String> forma
return this;
}

private Function<String, Object> getParser(Class<?> type) {
private Function<String, ?> getParser(Class<?> type) {
if(type.equals(String.class)) return String::valueOf;
if(type.equals(Double.class)) return Double::valueOf;
if(type.equals(Float.class)) return Float::valueOf;
Expand Down Expand Up @@ -266,7 +266,7 @@ public boolean guessParser() {
/**
* @return Parser to use when converting table entries into data objects.
*/
public Function<String, Object> parser() {
public Function<String, ?> parser() {
return getValueOrDefault(parserKey, String::valueOf);
}

Expand Down

0 comments on commit e45f633

Please sign in to comment.