-
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.
Refactoring of model to be mroe generic
- Loading branch information
Showing
17 changed files
with
153 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,3 +175,6 @@ src/.DS_Store | |
src/main/.DS_Store | ||
src/main/raporting/.DS_Store | ||
!/.env | ||
|
||
.bin/ | ||
node_modules |
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
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
2 changes: 1 addition & 1 deletion
2
...hu/pocketstats/pocket/api/ItemStatus.java → ...u/cybershu/pocketstats/db/ItemStatus.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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package eu.cybershu.pocketstats.db; | ||
|
||
public enum Source { | ||
POCKET("pocket"), | ||
INSTAPAPER("instapaper"), | ||
READER("reader"); | ||
|
||
private final String sourceType; | ||
|
||
Source(String sourceType) { | ||
this.sourceType = sourceType; | ||
} | ||
} |
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
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
32 changes: 32 additions & 0 deletions
32
src/main/java/eu/cybershu/pocketstats/pocket/api/PocketItemStatus.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package eu.cybershu.pocketstats.pocket.api; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
public enum PocketItemStatus { | ||
TO_READ(0), | ||
ARCHIVED(1), | ||
DELETED(2); | ||
|
||
private final int status; | ||
|
||
PocketItemStatus(int status) { | ||
this.status = status; | ||
} | ||
|
||
@JsonValue | ||
public int getStatus() { | ||
return status; | ||
} | ||
|
||
@JsonCreator | ||
public static PocketItemStatus forValue(int status) { | ||
for (PocketItemStatus itemStatus : PocketItemStatus.values()) { | ||
if (itemStatus.getStatus() == status) { | ||
return itemStatus; | ||
} | ||
} | ||
|
||
throw new IllegalArgumentException("Unknown status: " + status); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/eu/cybershu/pocketstats/stats/StatsWithStatusType.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
Oops, something went wrong.