Skip to content

Cleaned up doc blocks in various classes #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/main/java/com/pokegoapi/api/gym/Battle.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public class Battle {

/**
* New battle to track the state of a battle.
*
* @param api The api instance to submit requests with.
* @param team The Pokemon to use for attacking in the battle.
* @param gym The Gym to fight at.
*/
public Battle(PokemonGo api, Pokemon[] team, Gym gym) {
this.team = team;
Expand All @@ -75,6 +77,8 @@ public Battle(PokemonGo api, Pokemon[] team, Gym gym) {
* Start a battle.
*
* @return Result of the attempt to start
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
public Result start() throws LoginFailedException, RemoteServerException {

Expand Down Expand Up @@ -120,6 +124,8 @@ public Result start() throws LoginFailedException, RemoteServerException {
*
* @param times the amount of times to attack
* @return Battle
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
public AttackGymResponse attack(int times) throws LoginFailedException, RemoteServerException {

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/pokegoapi/api/gym/Gym.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class Gym {

/**
* Gym object.
*
* @param api The api object to use for requests.
* @param proto The FortData to populate the Gym with.
*/
public Gym(PokemonGo api, FortData proto) {
this.api = api;
Expand Down Expand Up @@ -153,6 +154,8 @@ public List<GymMembership> getGymMembers() throws LoginFailedException, RemoteSe
* Get a list of pokemon defending this gym.
*
* @return List of pokemon
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
public List<PokemonData> getDefendingPokemon() throws LoginFailedException, RemoteServerException {
List<PokemonData> data = new ArrayList<PokemonData>();
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/com/pokegoapi/api/map/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public void clearCache() {
* Returns a list of catchable pokemon around the current location.
*
* @return a List of CatchablePokemon at your current location
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
public List<CatchablePokemon> getCatchablePokemon() throws LoginFailedException, RemoteServerException {
Set<CatchablePokemon> catchablePokemons = new HashSet<>();
Expand Down Expand Up @@ -124,6 +126,8 @@ public List<CatchablePokemon> getCatchablePokemon() throws LoginFailedException,
* Returns a list of nearby pokemon (non-catchable).
*
* @return a List of NearbyPokemon at your current location
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
public List<NearbyPokemon> getNearbyPokemon() throws LoginFailedException, RemoteServerException {
List<NearbyPokemon> pokemons = new ArrayList<>();
Expand All @@ -140,6 +144,8 @@ public List<NearbyPokemon> getNearbyPokemon() throws LoginFailedException, Remot
* Returns a list of spawn points.
*
* @return list of spawn points
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
public List<Point> getSpawnPoints() throws LoginFailedException, RemoteServerException {
List<Point> points = new ArrayList<>();
Expand All @@ -156,6 +162,8 @@ public List<Point> getSpawnPoints() throws LoginFailedException, RemoteServerExc
* Get a list of gyms near the current location.
*
* @return List of gyms
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
public List<Gym> getGyms() throws LoginFailedException, RemoteServerException {
List<Gym> gyms = new ArrayList<>();
Expand All @@ -174,6 +182,8 @@ public List<Gym> getGyms() throws LoginFailedException, RemoteServerException {
* Returns a list of decimated spawn points at current location.
*
* @return list of spawn points
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
public List<Point> getDecimatedSpawnPoints() throws LoginFailedException, RemoteServerException {
List<Point> points = new ArrayList<>();
Expand All @@ -190,6 +200,8 @@ public List<Point> getDecimatedSpawnPoints() throws LoginFailedException, Remote
* Returns MapObjects around your current location.
*
* @return MapObjects at your current location
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
public MapObjects getMapObjects() throws LoginFailedException, RemoteServerException {
return getMapObjects(9);
Expand All @@ -200,6 +212,9 @@ public MapObjects getMapObjects() throws LoginFailedException, RemoteServerExcep
*
* @param width width
* @return MapObjects at your current location
*
* @throws LoginFailedException If login fails.
* @throws RemoteServerException If request errors occurred.
*/
public MapObjects getMapObjects(int width) throws LoginFailedException, RemoteServerException {
return getMapObjects(
Expand All @@ -218,6 +233,8 @@ public MapObjects getMapObjects(int width) throws LoginFailedException, RemoteSe
* @param latitude latitude
* @param longitude longitude
* @return MapObjects in the given cells
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
@Deprecated
public MapObjects getMapObjects(double latitude, double longitude)
Expand All @@ -232,6 +249,8 @@ public MapObjects getMapObjects(double latitude, double longitude)
* @param latitude latitude
* @param longitude longitude
* @return MapObjects in the given cells
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
@Deprecated
public MapObjects getMapObjects(List<Long> cellIds, double latitude, double longitude)
Expand All @@ -246,6 +265,8 @@ public MapObjects getMapObjects(List<Long> cellIds, double latitude, double long
* @param longitude longitude
* @param width width
* @return MapObjects in the given cells
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
@Deprecated
public MapObjects getMapObjects(double latitude, double longitude, int width)
Expand All @@ -259,7 +280,10 @@ public MapObjects getMapObjects(double latitude, double longitude, int width)
* @param cellIds cellIds
* @param latitude latitude
* @param longitude longitude
* @param altitude altitude
* @return MapObjects in the given cells
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
@Deprecated
public MapObjects getMapObjects(List<Long> cellIds, double latitude, double longitude, double altitude)
Expand All @@ -275,6 +299,8 @@ public MapObjects getMapObjects(List<Long> cellIds, double latitude, double long
*
* @param cellIds List of cellId
* @return MapObjects in the given cells
* @throws LoginFailedException if the login failed
* @throws RemoteServerException When a buffer exception is thrown
*/
public MapObjects getMapObjects(List<Long> cellIds) throws LoginFailedException, RemoteServerException {
GetMapObjectsMessage.Builder builder = GetMapObjectsMessage.newBuilder();
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/pokegoapi/api/map/MapObjects.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ public boolean isComplete() {

/**
* updates the object.
*
*
* @param other Update this {@link MapObjects} data with the provided data.
*/
public void update(MapObjects other) {

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/pokegoapi/api/map/fort/Pokestop.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ public boolean hasLurePokemon() {
/**
* Returns whether this pokestop has an active lure.
* @return lure status
* @throws LoginFailedException If login failed.
* @throws RemoteServerException If server communications failed.
*/
public boolean hasLure() throws LoginFailedException, RemoteServerException {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/pokegoapi/api/player/PlayerProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void addCurrency(String name, int amount) throws InvalidCurrencyException
* Check and equip badges.
*
* @throws LoginFailedException if the login failed
* @throws InvalidCurrencyException the invalid currency exception
* @throws RemoteServerException When a buffer exception is thrown
*/

public void checkAndEquipBadges() throws LoginFailedException, RemoteServerException {
Expand Down
24 changes: 18 additions & 6 deletions src/main/java/com/pokegoapi/api/pokemon/Pokemon.java
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ public float getLevel() {
* Calculate the maximum CP for this individual pokemon
*
* @return The maximum CP for this pokemon
* @throws NoSuchItemException If the PokemonId value cannot be found in the {@link PokemonMetaRegistry}.
*/
public int getMaxCp() throws NoSuchItemException {
PokemonMeta pokemonMeta = PokemonMetaRegistry.getMeta(proto.getPokemonId());
Expand All @@ -427,6 +428,7 @@ public int getMaxCp() throws NoSuchItemException {
* Calculates the absolute maximum CP for all pokemons with this PokemonId
*
* @return The absolute maximum CP
* @throws NoSuchItemException If the PokemonId value cannot be found in the {@link PokemonMetaRegistry}.
*/
public int getAbsoluteMaxCp() throws NoSuchItemException {
return getAbsoluteMaxCp(proto.getPokemonId());
Expand All @@ -435,7 +437,9 @@ public int getAbsoluteMaxCp() throws NoSuchItemException {

/**
* Static helper to get the absolute maximum CP for pokemons with their PokemonId.
* + * @return The absolute maximum CP
* @param id The {@link POGOProtos.Enums.PokemonIdOuterClass.PokemonId} of the Pokemon to get CP for.
* @return The absolute maximum CP
* @throws NoSuchItemException If the PokemonId value cannot be found in the {@link PokemonMetaRegistry}.
*/
public static int getAbsoluteMaxCp(PokemonIdOuterClass.PokemonId id) throws NoSuchItemException {
PokemonMeta pokemonMeta = PokemonMetaRegistry.getMeta(id);
Expand Down Expand Up @@ -499,6 +503,8 @@ public boolean isFainted() {
* Heal a pokemon, using various fallbacks for potions
*
* @return Result, ERROR_CANNOT_USE if the requirements arent met
* @throws LoginFailedException If login failed.
* @throws RemoteServerException If server communication issues occurred.
*/
public UseItemPotionResponseOuterClass.UseItemPotionResponse.Result heal()
throws LoginFailedException, RemoteServerException {
Expand All @@ -522,10 +528,12 @@ public UseItemPotionResponseOuterClass.UseItemPotionResponse.Result heal()
}

/**
* use a potion on that pokemon. Will check if there is enough potions & if the pokemon need
* use a potion on that pokemon. Will check if there is enough potions and if the pokemon need
* to be healed.
*
* @return Result, ERROR_CANNOT_USE if the requirements arent met
* @param itemId {@link ItemId} of the potion to use.
* @return Result, ERROR_CANNOT_USE if the requirements aren't met
* @throws LoginFailedException If login failed.
* @throws RemoteServerException If server communications failed.
*/
public UseItemPotionResponseOuterClass.UseItemPotionResponse.Result usePotion(ItemId itemId)
throws LoginFailedException, RemoteServerException {
Expand Down Expand Up @@ -560,6 +568,8 @@ public UseItemPotionResponseOuterClass.UseItemPotionResponse.Result usePotion(It
* Revive a pokemon, using various fallbacks for revive items
*
* @return Result, ERROR_CANNOT_USE if the requirements arent met
* @throws LoginFailedException If login failed.
* @throws RemoteServerException If server communications failed.
*/
public UseItemReviveResponseOuterClass.UseItemReviveResponse.Result revive()
throws LoginFailedException, RemoteServerException {
Expand All @@ -577,10 +587,12 @@ public UseItemReviveResponseOuterClass.UseItemReviveResponse.Result revive()
}

/**
* Use a revive item on the pokemon. Will check if there is enough revive & if the pokemon need
* Use a revive item on the pokemon. Will check if there is enough revive &amp; if the pokemon need
* to be revived.
*
* @param itemId {@link ItemId} of the Revive to use.
* @return Result, ERROR_CANNOT_USE if the requirements arent met
* @throws LoginFailedException If login failed.
* @throws RemoteServerException If server communications failed.
*/
public UseItemReviveResponseOuterClass.UseItemReviveResponse.Result useRevive(ItemId itemId)
throws LoginFailedException, RemoteServerException {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/pokegoapi/api/settings/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public class Settings {
/**
* Settings object that hold different configuration aspect of the game.
* Can be used to simulate the real app behaviour.
*
* @param api api instance
* @throws LoginFailedException If login failed.
* @throws RemoteServerException If server communications failed.
*/
public Settings(PokemonGo api) throws LoginFailedException, RemoteServerException {
this.api = api;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class CatchPokemonAtAreaExample {

/**
* Catches a pokemon at an area.
* @param args args
*/
public static void main(String[] args) {
OkHttpClient http = new OkHttpClient();
Expand Down
Loading