Skip to content

Commit 4cf57ed

Browse files
committed
Improve TemporalAmountParser roundOff method
1 parent 1674799 commit 4cf57ed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

eternalcode-commons-shared/src/main/java/com/eternalcode/commons/shared/time/TemporalAmountParser.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ public abstract class TemporalAmountParser<T extends TemporalAmount> {
4545

4646
private Set<ChronoUnit> roundedUnits = new HashSet<>();
4747

48-
public void roundOff(ChronoUnit unit) {
49-
roundedUnits.add(unit);
48+
public TemporalAmountParser<T> roundOff(ChronoUnit unit) {
49+
this.roundedUnits.add(unit);
50+
return this;
5051
}
5152

5253
static {

0 commit comments

Comments
 (0)