Class SomewhatNamedPerson


  • public class SomewhatNamedPerson
    extends Object
    Definition of a person with lastName and age, and optionally a firstName as well...
    Since:
    Some version.
    Author:
    Lennart Jörelid, jGuru Europe AB
    • Constructor Detail

      • SomewhatNamedPerson

        public SomewhatNamedPerson()
        JAXB-friendly constructor.
      • SomewhatNamedPerson

        public SomewhatNamedPerson​(String firstName,
                                   String lastName,
                                   int age)
        Creates a SomewhatNamedPerson wrapping the supplied data.
        Parameters:
        firstName - The first name of the SomewhatNamedPerson.
        lastName - The last name of the SomewhatNamedPerson. Cannot be null.
        age - The age of the SomewhatNamedPerson. Must be positive.
    • Method Detail

      • getFirstName

        public String getFirstName()
        Retrieves the first name of this SomewhatNamedPerson.
        Returns:
        The first name of this SomewhatNamedPerson, converting null values to empty strings.
      • getFirstName

        public String getFirstName​(boolean replaceNull)
        Retrieves the first name of this SomewhatNamedPerson.
        Parameters:
        replaceNull - indicates if this method should replace null firstName values with an empty string.
        Returns:
        The first name of this SomewhatNamedPerson, optionally converting null values to empty strings.
      • getLastName

        public String getLastName()
        Returns:
        The last name of this SomewhatNamedPerson. Never null.
      • getAge

        public int getAge()
        Returns:
        The age of this SomewhatNamedPerson.