-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: EntireStatistic 구현체 생성 메소드 추가(#114)
- Loading branch information
Showing
4 changed files
with
38 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 14 additions & 2 deletions
16
src/main/java/com/dnd/namuiwiki/domain/statistic/model/EntireStatistic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
package com.dnd.namuiwiki.domain.statistic.model; | ||
|
||
public interface EntireStatistic { | ||
void updateStatistic(String... arguments); | ||
import com.dnd.namuiwiki.domain.statistic.type.StatisticsCalculationType; | ||
|
||
public abstract class EntireStatistic { | ||
public abstract void updateStatistic(String... arguments); | ||
|
||
public static EntireStatistic createEmpty(StatisticsCalculationType type) { | ||
switch (type) { | ||
case AVERAGE: | ||
return new AverageEntireStatistic(0L, 0L); | ||
default: | ||
throw new IllegalArgumentException("Not supported type: " + type); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters