The Java API is missing a number of guild features (such as ranks, as pointed out in #463), so this PR aims to add those, as well as refactoring areas of the Java API relating to guilds.
GuildReply.java
Added documentation
Made immutable
Removed unnecessary boxed types (namely Boolean)
Added equals and hashCode
Added some missing stats:
Guild.getRanks()
Guild.getPreferredGames()
Guild.getExperienceForGame(GameType) - from web API's guildExpByGameType field
Guild.getAchievementHighScore(GuildAchievement) - from web API's achievements field
Member.getExperienceEarned(LocalDate) - from web API's members[i].expHistory field
EDIT
When making this, I purposefully left out 3 fields in particular. The reason for this is that they represent the guild's internal state, and I wouldn't be very surprised if the devs eventually chose to hide/remove them (like they have in the past with certain fields in the "player" endpoint). These fields are:
guild.chatMute
guild.members[i].mutedTill
guild.hideGmTag
If there's any demand for these fields and the devs can confirm that they're intended to be public, I'd be fine adding them. But I'd rather not add them in the first place if there's any chance of them suddenly becoming inaccessible and breaking someone's app.
The Java API is missing a number of guild features (such as
ranks
, as pointed out in #463), so this PR aims to add those, as well as refactoring areas of the Java API relating to guilds.GuildReply.java
Boolean
)Guild.getRanks()
Guild.getPreferredGames()
Guild.getExperienceForGame(GameType)
- from web API'sguildExpByGameType
fieldGuild.getAchievementHighScore(GuildAchievement)
- from web API'sachievements
fieldMember.getExperienceEarned(LocalDate)
- from web API'smembers[i].expHistory
field get_id() -> getId()
,getCreated() -> getCreationDate()
, etc)Guild.getLegacyRanking()
0
for guilds created after the guild update (those without a ranking)0
was also used to represent 1st place (for "The Foundation" guild).-1
in those cases.Banner.java
Banner.getBase() --> Banner.getBaseColor()
Pattern.getPattern() --> Pattern.getType()
GetGuildExample.java
GetPlayerExample
GuildAchievement.java
getAchievementHighScore()
in theGuild
classResolves #463
EDIT
When making this, I purposefully left out 3 fields in particular. The reason for this is that they represent the guild's internal state, and I wouldn't be very surprised if the devs eventually chose to hide/remove them (like they have in the past with certain fields in the "player" endpoint). These fields are:guild.chatMute
guild.members[i].mutedTill
guild.hideGmTag