Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone create this class for me? CLASS PERSON Person -tullName: String - -p

ID: 645632 • Letter: C

Question

Can someone create this class for me?

CLASS PERSON

Person -tullName: String - -phoneNumber: String -email: String +Person(fullName: String, phoneNumber: String, email: String) +Person +4getFullName(): String +gefullName(ful name: String) void +getPhoneNumber(): String +getPhoneNurnber(phoneNumber: String): void +getEmail): String +getemall(email: String): void +toString(): String -validateString(value: String, fieldName. String, maxlerigth: int): void Simple Class Has three fields, fullName, phoneNumber, email Two constructors, both throws ValidationException Default constructor should set all fields to unknown Gets and Sets for the fields Each Set can throws Validation Exception validateString method, static and will throw ValidationExceptions with an appropriate message based on arguments sent to parameters. Note: throw validation exceptions: fullName cannot be null or empty or only whitespace and cannot exceed 50 characters. phoneNumber cannot be null or empty or only whitespace and cannot exceed 15 characters. email cannot be null or empty or only whitespace and cannot exceed 35 characters. None of the fields should contain a comma , character. toString0 should return fullName, phoneNumber, and email separated by commas. Using either a StringBuilder or string.format is acceptable.

Explanation / Answer

public class Person {

    private String name;

    private String title;

    private String address;

    /**

     * Constructor to create Person object

     */

    public Person() {

    }

    /**

     * Constructor with parameter

     *

     * @param name

     */

    public Person(String name) {

        this.name = name;

    }

    /**

     * Method to get the name of person

     *

     * @return name

     */

    public String getName() {

        return name;

    }

    /**

     * Method to set the name of person

     *

     * @param name

     */

    public void setName(String name) {

        this.name = name;

    }

    /**

     * Method to get the title of person

     *

     * @return title

     */

    public String getTitle() {

        return title;

    }

    /**

     * Method to set the title of person

     *

     * @param title

     */

    public void setTitle(String title) {

        this.title = title;

    }

    /**

     * Method to get address of person

     *

     * @return address

     */

    public String getAddress() {

        return address;

    }

    /**

     * Method to set the address of person

     *

     * @param address

     */

    public void setAddress(String address) {

        this.address = address;

    }

    /**

     * Method to get name with title of person

     *

     * @return nameTitle

     */

    public String getNameWithTitle() {

        String nameTitle;

        if (title != null) {

            nameTitle = name + ", " + title;

        } else {

            nameTitle = name;

        }

        return nameTitle;

    }

    /**

     * Method used to print the information of person

     */

    @Override

    public String toString() {

        return "Info [" +

                "name='" + name + ''' +

                ", title='" + title + ''' +

                ", address='" + address + ''' +

                ']';

    }

}