taycaldwell / riot-api-java

Riot Games API Java Library
http://taycaldwell.github.io/riot-api-java/
Apache License 2.0
192 stars 73 forks source link

Queue Constants #107

Open OwenVey opened 7 years ago

OwenVey commented 7 years ago

Is there a plan to add constants for Queue ID's like you have for Platform and Region constants?

taycaldwell commented 7 years ago

Constants for queues existed before. Had to do some digging to see why they were removed.

It looks like they were removed with the update to support League v3, as the methods now take a String representation of the queue type rather than the enum.

https://github.com/taycaldwell/riot-api-java/commit/2aa282822136f0ebdaa3905913cbca4a27282438

I know some devs found these enums to be helpful for comparison of returned String values from the API, so I'm not sure I necessarily agree with this recent change. I also don't like the idea of having to construct and pass String parameters for a well-known set of values into methods.

I guess I will ask you - would you find the addition of these constants to be useful, and if so, why?

OwenVey commented 7 years ago

I think that these methods would only benefit devs as it allows them to access the constants quickly without having to refer to the Game Constants Documentation to find the ID of a certain Queue.

taycaldwell commented 7 years ago

Right. It would be ideal for devs using the library to not have to refer to external documentation or the Dev Portal to get this information.

Linnun commented 7 years ago

When converting to the V3 API, I basically kicked out the V1/V2 methods and the then unused enums. There is no particular reason why we should not (re)invent a few enums wherever it's appropriate.

Since the queue type from leagues does NOT neccessarily match actual queue types, this definitely should be an endpoint specific enum, offering only values that are actually used for league queue types.

Linnun commented 7 years ago

I have added a LeagueQueue constant specific to the league endpoint: https://github.com/taycaldwell/riot-api-java/commit/79189dafec2dfb07787d2c2439280a9af2a7d0d5