-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #66 Don't manually read JSON values, deserialize into a Java object
- Loading branch information
1 parent
a440405
commit 02b52db
Showing
7 changed files
with
51 additions
and
32 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
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,10 +1,15 @@ | ||
package com.faforever.api.clan.result; | ||
|
||
import com.faforever.api.data.domain.Clan; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class ClanResult { | ||
private final int id; | ||
private final String tag; | ||
private final String name; | ||
|
||
public static ClanResult of(Clan clan) { | ||
return new ClanResult(clan.getId(), clan.getTag(), clan.getName()); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/faforever/api/clan/result/InvitationResult.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,14 @@ | ||
package com.faforever.api.clan.result; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class InvitationResult { | ||
private final long expire; | ||
private final ClanResult clan; | ||
private final PlayerResult newMember; | ||
|
||
public boolean isExpired() { | ||
return expire < System.currentTimeMillis(); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/faforever/api/clan/result/PlayerResult.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,9 +1,14 @@ | ||
package com.faforever.api.clan.result; | ||
|
||
import com.faforever.api.data.domain.Player; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class PlayerResult { | ||
private final int id; | ||
private final String login; | ||
|
||
public static PlayerResult of(Player newMember) { | ||
return new PlayerResult(newMember.getId(), newMember.getLogin()); | ||
} | ||
} |
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