CodeCleanup in Player, Tournament and Participant
This commit is contained in:
parent
e0a9d963f6
commit
67003ad772
|
@ -4,7 +4,7 @@ import java.io.Serializable;
|
||||||
|
|
||||||
public interface Participant extends Serializable {
|
public interface Participant extends Serializable {
|
||||||
String getName();
|
String getName();
|
||||||
void setName(String name);
|
void setName(String name) throws InvalidNameException;
|
||||||
boolean equals(Participant participant);
|
boolean equals(Participant participant);
|
||||||
void change(Participant participant) throws Person.InvalidPhoneNumberException;
|
void change(Participant participant) throws Person.InvalidPhoneNumberException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class Player extends Person implements Participant {
|
||||||
/**
|
/**
|
||||||
* Override of equals method to compare participants against each other
|
* 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
|
* @return true if equals, false if not
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -114,7 +114,7 @@ public class Player extends Person implements Participant {
|
||||||
* @param participant the new participant to be added
|
* @param participant the new participant to be added
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void change(Participant participant) {
|
public void change(Participant participant) throws InvalidPhoneNumberException {
|
||||||
logger.fine("changing the current Player " + this + "with " + participant.getName());
|
logger.fine("changing the current Player " + this + "with " + participant.getName());
|
||||||
Player player = (Player) participant;
|
Player player = (Player) participant;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class Tournament implements Serializable {
|
||||||
*
|
*
|
||||||
* @param newParticipant the Participant to be saved or edited
|
* @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");
|
logger.fine("Trying to add " + newParticipant + " into the tournament");
|
||||||
for (Participant participant : participants) {
|
for (Participant participant : participants) {
|
||||||
if (participant.equals(newParticipant)) {
|
if (participant.equals(newParticipant)) {
|
||||||
|
|
Loading…
Reference in New Issue