Skip to content

Commit 65c8819

Browse files
mashurexGrover-c13
authored andcommitted
Cleaned up some doc blocks (#352)
1 parent ef8079b commit 65c8819

File tree

17 files changed

+204
-52
lines changed

17 files changed

+204
-52
lines changed

src/main/java/com/pokegoapi/api/gym/Battle.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ public class Battle {
5656

5757
/**
5858
* New battle to track the state of a battle.
59-
*
59+
* @param api The api instance to submit requests with.
60+
* @param team The Pokemon to use for attacking in the battle.
61+
* @param gym The Gym to fight at.
6062
*/
6163
public Battle(PokemonGo api, Pokemon[] team, Gym gym) {
6264
this.team = team;
@@ -75,6 +77,8 @@ public Battle(PokemonGo api, Pokemon[] team, Gym gym) {
7577
* Start a battle.
7678
*
7779
* @return Result of the attempt to start
80+
* @throws LoginFailedException if the login failed
81+
* @throws RemoteServerException When a buffer exception is thrown
7882
*/
7983
public Result start() throws LoginFailedException, RemoteServerException {
8084

@@ -120,6 +124,8 @@ public Result start() throws LoginFailedException, RemoteServerException {
120124
*
121125
* @param times the amount of times to attack
122126
* @return Battle
127+
* @throws LoginFailedException if the login failed
128+
* @throws RemoteServerException When a buffer exception is thrown
123129
*/
124130
public AttackGymResponse attack(int times) throws LoginFailedException, RemoteServerException {
125131

src/main/java/com/pokegoapi/api/gym/Gym.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public class Gym {
4444

4545
/**
4646
* Gym object.
47-
*
47+
* @param api The api object to use for requests.
48+
* @param proto The FortData to populate the Gym with.
4849
*/
4950
public Gym(PokemonGo api, FortData proto) {
5051
this.api = api;
@@ -153,6 +154,8 @@ public List<GymMembership> getGymMembers() throws LoginFailedException, RemoteSe
153154
* Get a list of pokemon defending this gym.
154155
*
155156
* @return List of pokemon
157+
* @throws LoginFailedException if the login failed
158+
* @throws RemoteServerException When a buffer exception is thrown
156159
*/
157160
public List<PokemonData> getDefendingPokemon() throws LoginFailedException, RemoteServerException {
158161
List<PokemonData> data = new ArrayList<PokemonData>();

src/main/java/com/pokegoapi/api/map/Map.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ public void clearCache() {
9797
* Returns a list of catchable pokemon around the current location.
9898
*
9999
* @return a List of CatchablePokemon at your current location
100+
* @throws LoginFailedException if the login failed
101+
* @throws RemoteServerException When a buffer exception is thrown
100102
*/
101103
public List<CatchablePokemon> getCatchablePokemon() throws LoginFailedException, RemoteServerException {
102104
Set<CatchablePokemon> catchablePokemons = new HashSet<>();
@@ -124,6 +126,8 @@ public List<CatchablePokemon> getCatchablePokemon() throws LoginFailedException,
124126
* Returns a list of nearby pokemon (non-catchable).
125127
*
126128
* @return a List of NearbyPokemon at your current location
129+
* @throws LoginFailedException if the login failed
130+
* @throws RemoteServerException When a buffer exception is thrown
127131
*/
128132
public List<NearbyPokemon> getNearbyPokemon() throws LoginFailedException, RemoteServerException {
129133
List<NearbyPokemon> pokemons = new ArrayList<>();
@@ -140,6 +144,8 @@ public List<NearbyPokemon> getNearbyPokemon() throws LoginFailedException, Remot
140144
* Returns a list of spawn points.
141145
*
142146
* @return list of spawn points
147+
* @throws LoginFailedException if the login failed
148+
* @throws RemoteServerException When a buffer exception is thrown
143149
*/
144150
public List<Point> getSpawnPoints() throws LoginFailedException, RemoteServerException {
145151
List<Point> points = new ArrayList<>();
@@ -156,6 +162,8 @@ public List<Point> getSpawnPoints() throws LoginFailedException, RemoteServerExc
156162
* Get a list of gyms near the current location.
157163
*
158164
* @return List of gyms
165+
* @throws LoginFailedException if the login failed
166+
* @throws RemoteServerException When a buffer exception is thrown
159167
*/
160168
public List<Gym> getGyms() throws LoginFailedException, RemoteServerException {
161169
List<Gym> gyms = new ArrayList<>();
@@ -174,6 +182,8 @@ public List<Gym> getGyms() throws LoginFailedException, RemoteServerException {
174182
* Returns a list of decimated spawn points at current location.
175183
*
176184
* @return list of spawn points
185+
* @throws LoginFailedException if the login failed
186+
* @throws RemoteServerException When a buffer exception is thrown
177187
*/
178188
public List<Point> getDecimatedSpawnPoints() throws LoginFailedException, RemoteServerException {
179189
List<Point> points = new ArrayList<>();
@@ -190,6 +200,8 @@ public List<Point> getDecimatedSpawnPoints() throws LoginFailedException, Remote
190200
* Returns MapObjects around your current location.
191201
*
192202
* @return MapObjects at your current location
203+
* @throws LoginFailedException if the login failed
204+
* @throws RemoteServerException When a buffer exception is thrown
193205
*/
194206
public MapObjects getMapObjects() throws LoginFailedException, RemoteServerException {
195207
return getMapObjects(9);
@@ -200,6 +212,9 @@ public MapObjects getMapObjects() throws LoginFailedException, RemoteServerExcep
200212
*
201213
* @param width width
202214
* @return MapObjects at your current location
215+
*
216+
* @throws LoginFailedException If login fails.
217+
* @throws RemoteServerException If request errors occurred.
203218
*/
204219
public MapObjects getMapObjects(int width) throws LoginFailedException, RemoteServerException {
205220
return getMapObjects(
@@ -218,6 +233,8 @@ public MapObjects getMapObjects(int width) throws LoginFailedException, RemoteSe
218233
* @param latitude latitude
219234
* @param longitude longitude
220235
* @return MapObjects in the given cells
236+
* @throws LoginFailedException if the login failed
237+
* @throws RemoteServerException When a buffer exception is thrown
221238
*/
222239
@Deprecated
223240
public MapObjects getMapObjects(double latitude, double longitude)
@@ -232,6 +249,8 @@ public MapObjects getMapObjects(double latitude, double longitude)
232249
* @param latitude latitude
233250
* @param longitude longitude
234251
* @return MapObjects in the given cells
252+
* @throws LoginFailedException if the login failed
253+
* @throws RemoteServerException When a buffer exception is thrown
235254
*/
236255
@Deprecated
237256
public MapObjects getMapObjects(List<Long> cellIds, double latitude, double longitude)
@@ -246,6 +265,8 @@ public MapObjects getMapObjects(List<Long> cellIds, double latitude, double long
246265
* @param longitude longitude
247266
* @param width width
248267
* @return MapObjects in the given cells
268+
* @throws LoginFailedException if the login failed
269+
* @throws RemoteServerException When a buffer exception is thrown
249270
*/
250271
@Deprecated
251272
public MapObjects getMapObjects(double latitude, double longitude, int width)
@@ -259,7 +280,10 @@ public MapObjects getMapObjects(double latitude, double longitude, int width)
259280
* @param cellIds cellIds
260281
* @param latitude latitude
261282
* @param longitude longitude
283+
* @param altitude altitude
262284
* @return MapObjects in the given cells
285+
* @throws LoginFailedException if the login failed
286+
* @throws RemoteServerException When a buffer exception is thrown
263287
*/
264288
@Deprecated
265289
public MapObjects getMapObjects(List<Long> cellIds, double latitude, double longitude, double altitude)
@@ -275,6 +299,8 @@ public MapObjects getMapObjects(List<Long> cellIds, double latitude, double long
275299
*
276300
* @param cellIds List of cellId
277301
* @return MapObjects in the given cells
302+
* @throws LoginFailedException if the login failed
303+
* @throws RemoteServerException When a buffer exception is thrown
278304
*/
279305
public MapObjects getMapObjects(List<Long> cellIds) throws LoginFailedException, RemoteServerException {
280306
GetMapObjectsMessage.Builder builder = GetMapObjectsMessage.newBuilder();

src/main/java/com/pokegoapi/api/map/MapObjects.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ public boolean isComplete() {
164164

165165
/**
166166
* updates the object.
167-
*
168-
*
167+
* @param other Update this {@link MapObjects} data with the provided data.
169168
*/
170169
public void update(MapObjects other) {
171170

src/main/java/com/pokegoapi/api/map/fort/Pokestop.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ public boolean hasLurePokemon() {
194194
/**
195195
* Returns whether this pokestop has an active lure.
196196
* @return lure status
197+
* @throws LoginFailedException If login failed.
198+
* @throws RemoteServerException If server communications failed.
197199
*/
198200
public boolean hasLure() throws LoginFailedException, RemoteServerException {
199201

src/main/java/com/pokegoapi/api/player/PlayerProfile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void addCurrency(String name, int amount) throws InvalidCurrencyException
195195
* Check and equip badges.
196196
*
197197
* @throws LoginFailedException if the login failed
198-
* @throws InvalidCurrencyException the invalid currency exception
198+
* @throws RemoteServerException When a buffer exception is thrown
199199
*/
200200

201201
public void checkAndEquipBadges() throws LoginFailedException, RemoteServerException {

src/main/java/com/pokegoapi/api/pokemon/Pokemon.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ public float getLevel() {
411411
* Calculate the maximum CP for this individual pokemon
412412
*
413413
* @return The maximum CP for this pokemon
414+
* @throws NoSuchItemException If the PokemonId value cannot be found in the {@link PokemonMetaRegistry}.
414415
*/
415416
public int getMaxCp() throws NoSuchItemException {
416417
PokemonMeta pokemonMeta = PokemonMetaRegistry.getMeta(proto.getPokemonId());
@@ -427,6 +428,7 @@ public int getMaxCp() throws NoSuchItemException {
427428
* Calculates the absolute maximum CP for all pokemons with this PokemonId
428429
*
429430
* @return The absolute maximum CP
431+
* @throws NoSuchItemException If the PokemonId value cannot be found in the {@link PokemonMetaRegistry}.
430432
*/
431433
public int getAbsoluteMaxCp() throws NoSuchItemException {
432434
return getAbsoluteMaxCp(proto.getPokemonId());
@@ -435,7 +437,9 @@ public int getAbsoluteMaxCp() throws NoSuchItemException {
435437

436438
/**
437439
* Static helper to get the absolute maximum CP for pokemons with their PokemonId.
438-
* + * @return The absolute maximum CP
440+
* @param id The {@link POGOProtos.Enums.PokemonIdOuterClass.PokemonId} of the Pokemon to get CP for.
441+
* @return The absolute maximum CP
442+
* @throws NoSuchItemException If the PokemonId value cannot be found in the {@link PokemonMetaRegistry}.
439443
*/
440444
public static int getAbsoluteMaxCp(PokemonIdOuterClass.PokemonId id) throws NoSuchItemException {
441445
PokemonMeta pokemonMeta = PokemonMetaRegistry.getMeta(id);
@@ -499,6 +503,8 @@ public boolean isFainted() {
499503
* Heal a pokemon, using various fallbacks for potions
500504
*
501505
* @return Result, ERROR_CANNOT_USE if the requirements arent met
506+
* @throws LoginFailedException If login failed.
507+
* @throws RemoteServerException If server communication issues occurred.
502508
*/
503509
public UseItemPotionResponseOuterClass.UseItemPotionResponse.Result heal()
504510
throws LoginFailedException, RemoteServerException {
@@ -522,10 +528,12 @@ public UseItemPotionResponseOuterClass.UseItemPotionResponse.Result heal()
522528
}
523529

524530
/**
525-
* use a potion on that pokemon. Will check if there is enough potions & if the pokemon need
531+
* use a potion on that pokemon. Will check if there is enough potions and if the pokemon need
526532
* to be healed.
527-
*
528-
* @return Result, ERROR_CANNOT_USE if the requirements arent met
533+
* @param itemId {@link ItemId} of the potion to use.
534+
* @return Result, ERROR_CANNOT_USE if the requirements aren't met
535+
* @throws LoginFailedException If login failed.
536+
* @throws RemoteServerException If server communications failed.
529537
*/
530538
public UseItemPotionResponseOuterClass.UseItemPotionResponse.Result usePotion(ItemId itemId)
531539
throws LoginFailedException, RemoteServerException {
@@ -560,6 +568,8 @@ public UseItemPotionResponseOuterClass.UseItemPotionResponse.Result usePotion(It
560568
* Revive a pokemon, using various fallbacks for revive items
561569
*
562570
* @return Result, ERROR_CANNOT_USE if the requirements arent met
571+
* @throws LoginFailedException If login failed.
572+
* @throws RemoteServerException If server communications failed.
563573
*/
564574
public UseItemReviveResponseOuterClass.UseItemReviveResponse.Result revive()
565575
throws LoginFailedException, RemoteServerException {
@@ -577,10 +587,12 @@ public UseItemReviveResponseOuterClass.UseItemReviveResponse.Result revive()
577587
}
578588

579589
/**
580-
* Use a revive item on the pokemon. Will check if there is enough revive & if the pokemon need
590+
* Use a revive item on the pokemon. Will check if there is enough revive &amp; if the pokemon need
581591
* to be revived.
582-
*
592+
* @param itemId {@link ItemId} of the Revive to use.
583593
* @return Result, ERROR_CANNOT_USE if the requirements arent met
594+
* @throws LoginFailedException If login failed.
595+
* @throws RemoteServerException If server communications failed.
584596
*/
585597
public UseItemReviveResponseOuterClass.UseItemReviveResponse.Result useRevive(ItemId itemId)
586598
throws LoginFailedException, RemoteServerException {

src/main/java/com/pokegoapi/api/settings/Settings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public class Settings {
6060
/**
6161
* Settings object that hold different configuration aspect of the game.
6262
* Can be used to simulate the real app behaviour.
63+
*
64+
* @param api api instance
65+
* @throws LoginFailedException If login failed.
66+
* @throws RemoteServerException If server communications failed.
6367
*/
6468
public Settings(PokemonGo api) throws LoginFailedException, RemoteServerException {
6569
this.api = api;

src/main/java/com/pokegoapi/examples/CatchPokemonAtAreaExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class CatchPokemonAtAreaExample {
5050

5151
/**
5252
* Catches a pokemon at an area.
53+
* @param args args
5354
*/
5455
public static void main(String[] args) {
5556
OkHttpClient http = new OkHttpClient();

0 commit comments

Comments
 (0)