Better toString() methods for API classes

This commit is contained in:
Daniel Saukel 2021-01-26 20:00:20 +01:00
parent 1dc678eb9e
commit e72f117eb0
28 changed files with 140 additions and 0 deletions

View File

@ -47,4 +47,9 @@ public class DataReloadEvent extends Event implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName();
}
} }

View File

@ -89,4 +89,9 @@ public class GroupCollectRewardEvent extends GroupEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{group=" + group + "; collector=" + collector + "; reward=" + reward + "}";
}
} }

View File

@ -96,4 +96,9 @@ public class GroupCreateEvent extends GroupEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{group=" + group + "; creator=" + creator + "; cause=" + cause + "}";
}
} }

View File

@ -93,4 +93,9 @@ public class GroupDisbandEvent extends GroupEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{group=" + group + "; disbander=" + disbander + "; cause=" + cause + "}";
}
} }

View File

@ -67,4 +67,9 @@ public class GroupFinishDungeonEvent extends GroupEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{group=" + group + "; dungeon=" + dungeon + "}";
}
} }

View File

@ -87,4 +87,9 @@ public class GroupFinishFloorEvent extends GroupEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{group=" + group + "; finished=" + finished + "; next=" + next + "}";
}
} }

View File

@ -75,4 +75,9 @@ public class GroupPlayerJoinEvent extends GroupEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{group=" + group + "; player=" + player + "; creator=" + creator + "}";
}
} }

View File

@ -95,4 +95,9 @@ public class GroupPlayerKickEvent extends GroupEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{group=" + group + "; player=" + player + "; cause=" + cause + "}";
}
} }

View File

@ -64,4 +64,9 @@ public class GroupPlayerLeaveEvent extends GroupEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{group=" + group + "; player=" + player + "}";
}
} }

View File

@ -75,4 +75,9 @@ public class GroupScoreEvent extends GroupEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{group=" + group + "; scorer=" + scorer + "; loserGroup=" + loserGroup + "}";
}
} }

View File

@ -64,4 +64,9 @@ public class GroupStartFloorEvent extends GroupEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{group=" + group + "; gameWorld=" + gameWorld + "}";
}
} }

View File

@ -64,4 +64,9 @@ public class DungeonMobDeathEvent extends DungeonMobEvent implements Cancellable
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{mob=" + mob + "}";
}
} }

View File

@ -41,4 +41,9 @@ public class DungeonMobSpawnEvent extends DungeonMobEvent {
return handlers; return handlers;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{mob=" + mob + "}";
}
} }

View File

@ -51,4 +51,9 @@ public class EditPlayerEditEvent extends EditPlayerEvent {
return handlers; return handlers;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{player=" + globalPlayer + "; newlyLoaded=" + newlyLoaded + "}";
}
} }

View File

@ -83,4 +83,9 @@ public class EditPlayerLeaveEvent extends EditPlayerEvent implements Cancellable
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{player=" + globalPlayer + "; escape=" + escape + "; unloadIfEmpty=" + unloadIfEmpty + "}";
}
} }

View File

@ -92,4 +92,9 @@ public class GamePlayerDeathEvent extends GamePlayerEvent implements Cancellable
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{player=" + globalPlayer + "; keepInventory=" + keepInventory + "; lostLives=" + lostLives + "}";
}
} }

View File

@ -66,4 +66,9 @@ public class GamePlayerFinishEvent extends GamePlayerEvent implements Cancellabl
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{player=" + globalPlayer + "; hasToWait=" + hasToWait + "}";
}
} }

View File

@ -66,4 +66,9 @@ public class GlobalPlayerRewardPayOutEvent extends GlobalPlayerEvent implements
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{player=" + globalPlayer + "; rewards=" + rewards + "}";
}
} }

View File

@ -111,4 +111,9 @@ public class RequirementCheckEvent extends RequirementEvent implements Cancellab
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{requirement=" + requirement + "; player=" + player + "; keepInventory=" + keepInventory + "}";
}
} }

View File

@ -87,4 +87,9 @@ public class RequirementDemandEvent extends RequirementEvent implements Cancella
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{requirement=" + requirement + "; player=" + player + "; keepInventory=" + keepInventory + "}";
}
} }

View File

@ -39,4 +39,9 @@ public class EditWorldGenerateEvent extends EditWorldEvent {
return handlers; return handlers;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{instance=" + instance + "}";
}
} }

View File

@ -51,4 +51,9 @@ public class EditWorldSaveEvent extends EditWorldEvent implements Cancellable {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{instance=" + instance + "}";
}
} }

View File

@ -71,4 +71,9 @@ public class EditWorldUnloadEvent extends InstanceWorldUnloadEvent {
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{instance=" + instance + "; save=" + save + "}";
}
} }

View File

@ -64,4 +64,9 @@ public class GameWorldStartGameEvent extends GameWorldEvent implements Cancellab
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{instance=" + instance + "; dungeon=" + getDungeon() + "; game=" + game + "}";
}
} }

View File

@ -59,4 +59,9 @@ public class InstanceWorldPostUnloadEvent extends ResourceWorldEvent {
return handlers; return handlers;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{resource=" + resource + "; instanceWorldName=" + instanceWorldName + "}";
}
} }

View File

@ -51,4 +51,9 @@ public class InstanceWorldUnloadEvent extends InstanceWorldEvent implements Canc
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{instance=" + instance + "}";
}
} }

View File

@ -74,4 +74,9 @@ public class ResourceWorldInstantiateEvent extends ResourceWorldEvent implements
this.cancelled = cancelled; this.cancelled = cancelled;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{resource=" + resource + "; instanceWorldName=" + instanceWorldName + "}";
}
} }

View File

@ -127,4 +127,9 @@ public class PlayerClass {
this.dog = dog; this.dog = dog;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{name=" + name + "}";
}
} }