Skip to content

Commit 034af79

Browse files
committed
SpreadsheetCellValueKind.cellValue typed was Object
- Previously all methods returned Object, now they return the true type.
1 parent 5f58acb commit 034af79

1 file changed

Lines changed: 26 additions & 13 deletions

File tree

src/main/java/walkingkooka/spreadsheet/value/SpreadsheetCellValueKind.java

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,21 @@
1717

1818
package walkingkooka.spreadsheet.value;
1919

20+
import walkingkooka.datetime.DateTimeSymbols;
2021
import walkingkooka.io.FileExtension;
22+
import walkingkooka.math.DecimalNumberSymbols;
23+
import walkingkooka.spreadsheet.format.provider.SpreadsheetFormatterSelector;
24+
import walkingkooka.spreadsheet.formula.SpreadsheetFormula;
25+
import walkingkooka.spreadsheet.parser.provider.SpreadsheetParserSelector;
2126
import walkingkooka.text.CaseKind;
27+
import walkingkooka.tree.text.TextNode;
28+
import walkingkooka.tree.text.TextStyle;
29+
import walkingkooka.validation.ValueType;
30+
import walkingkooka.validation.provider.ValidatorSelector;
31+
32+
import java.util.Currency;
33+
import java.util.Locale;
34+
import java.util.Optional;
2235

2336
/**
2437
* Directive that controls what part of a cell to export or when importing what part of a cell to replace.
@@ -27,93 +40,93 @@ public enum SpreadsheetCellValueKind {
2740

2841
CELL {
2942
@Override
30-
public Object cellValue(final SpreadsheetCell cell) {
43+
public SpreadsheetCell cellValue(final SpreadsheetCell cell) {
3144
return cell;
3245
}
3346
},
3447

3548
CURRENCY {
3649
@Override
37-
public Object cellValue(final SpreadsheetCell cell) {
50+
public Optional<Currency> cellValue(final SpreadsheetCell cell) {
3851
return cell.currency();
3952
}
4053
},
4154

4255
DATE_TIME_SYMBOLS {
4356
@Override
44-
public Object cellValue(final SpreadsheetCell cell) {
57+
public Optional<DateTimeSymbols> cellValue(final SpreadsheetCell cell) {
4558
return cell.dateTimeSymbols();
4659
}
4760
},
4861

4962
DECIMAL_NUMBER_SYMBOLS {
5063
@Override
51-
public Object cellValue(final SpreadsheetCell cell) {
64+
public Optional<DecimalNumberSymbols> cellValue(final SpreadsheetCell cell) {
5265
return cell.decimalNumberSymbols();
5366
}
5467
},
5568

5669
FORMULA {
5770
@Override
58-
public Object cellValue(final SpreadsheetCell cell) {
71+
public SpreadsheetFormula cellValue(final SpreadsheetCell cell) {
5972
return cell.formula();
6073
}
6174
},
6275

6376
FORMATTER {
6477
@Override
65-
public Object cellValue(final SpreadsheetCell cell) {
78+
public Optional<SpreadsheetFormatterSelector> cellValue(final SpreadsheetCell cell) {
6679
return cell.formatter();
6780
}
6881
},
6982

7083
LOCALE {
7184
@Override
72-
public Object cellValue(final SpreadsheetCell cell) {
85+
public Optional<Locale> cellValue(final SpreadsheetCell cell) {
7386
return cell.locale();
7487
}
7588
},
7689

7790
PARSER {
7891
@Override
79-
public Object cellValue(final SpreadsheetCell cell) {
92+
public Optional<SpreadsheetParserSelector> cellValue(final SpreadsheetCell cell) {
8093
return cell.parser();
8194
}
8295
},
8396

8497
STYLE {
8598
@Override
86-
public Object cellValue(final SpreadsheetCell cell) {
99+
public TextStyle cellValue(final SpreadsheetCell cell) {
87100
return cell.style();
88101
}
89102
},
90103

91104
VALIDATOR {
92105
@Override
93-
public Object cellValue(final SpreadsheetCell cell) {
106+
public Optional<ValidatorSelector> cellValue(final SpreadsheetCell cell) {
94107
return cell.validator();
95108
}
96109
},
97110

98111
VALUE {
99112
@Override
100-
public Object cellValue(final SpreadsheetCell cell) {
113+
public Optional<Object> cellValue(final SpreadsheetCell cell) {
101114
return cell.formula()
102115
.value();
103116
}
104117
},
105118

106119
VALUE_TYPE {
107120
@Override
108-
public Object cellValue(final SpreadsheetCell cell) {
121+
public Optional<ValueType> cellValue(final SpreadsheetCell cell) {
109122
return cell.formula()
110123
.valueType();
111124
}
112125
},
113126

114127
FORMATTED_VALUE {
115128
@Override
116-
public Object cellValue(final SpreadsheetCell cell) {
129+
public Optional<TextNode> cellValue(final SpreadsheetCell cell) {
117130
return cell.formattedValue();
118131
}
119132
};

0 commit comments

Comments
 (0)