Logging and docs added to classes Person, Place and Player #27 #28 #50

Merged
brandleo merged 10 commits from logging_and_docs into main 2022-05-13 17:49:39 +02:00
3 changed files with 6 additions and 6 deletions
Showing only changes of commit 67003ad772 - Show all commits

View File

@ -4,7 +4,7 @@ import java.io.Serializable;
public interface Participant extends Serializable {
String getName();
void setName(String name);
void setName(String name) throws InvalidNameException;
boolean equals(Participant participant);
void change(Participant participant) throws Person.InvalidPhoneNumberException;
}

View File

@ -99,7 +99,7 @@ public class Player extends Person implements Participant {
/**
* Override of equals method to compare participants against each other
*
* @param participant
* @param participant to be compared with this instance
* @return true if equals, false if not
*/
@Override
@ -114,7 +114,7 @@ public class Player extends Person implements Participant {
* @param participant the new participant to be added
*/
@Override
public void change(Participant participant) {
public void change(Participant participant) throws InvalidPhoneNumberException {
logger.fine("changing the current Player " + this + "with " + participant.getName());
Player player = (Player) participant;

View File

@ -59,7 +59,7 @@ public class Tournament implements Serializable {
*
* @param newParticipant the Participant to be saved or edited
*/
public void saveParticipant(Participant newParticipant) {
public void saveParticipant(Participant newParticipant) throws Person.InvalidPhoneNumberException {
logger.fine("Trying to add " + newParticipant + " into the tournament");
for (Participant participant : participants) {
if (participant.equals(newParticipant)) {