Class Player

java.lang.Object
edu.ntnu.idatt1002.k2g05.models.Player
All Implemented Interfaces:
Serializable

public class Player extends Object implements Serializable
Class for holding a player in a competiton.
See Also:
  • Constructor Details

    • Player

      public Player(String name, char gender, char playerClass, String club, int license, double handicap, String country)
      Constructor for creating an instance of a player given his/her information.
      Parameters:
      name - of the player, full name. Can not be blank
      gender - of the player, must be 'M' for male of 'F' for female
      playerClass - class of the player
      club - that the player is associated with
      license - of the player
      handicap - of the player, must be positive.
      country - that the player is from
      Throws:
      IllegalArgumentException - if arguments are not ut to par.
      NullPointerException - if arguments are null.
  • Method Details

    • getName

      public String getName()
    • getGender

      public char getGender()
    • getPlayerClass

      public char getPlayerClass()
    • getClub

      public String getClub()
    • getLicense

      public int getLicense()
    • getHandicap

      public double getHandicap()
    • getCountry

      public String getCountry()
    • getInitials

      public String getInitials()
      Gets the initials of the player by spitting the name and getting every first character of the name.
      Returns:
      the initials.
    • toString

      public String toString()
      Overrides:
      toString in class Object