And this solution or inequality, quality control, the contact class, if the color misuses, the methods
are constructor's, we're going to throw an unchecked exception, which is going to force them to fix
their code.
We'll start with the constructor, the caller should not be allowed to pass on a name that is null or
blank, so if the name is null.
Our name is Blank.
Then we'll throw a new illegal argument exception.
Name cannot be null or a blank.
We'll do the same thing for the phone number.
If the phone number is null.
Or blank.
We'll throw in a legal argument exception.
The phone number also can't be less than five characters, so we'll check if the phone number at length.
Is less than five.
We'll throw another exception.
Ken, how should we throw an illegal argument, exception of birth date is another blank.
You can if you want, I would say it's not necessary simply because the constructor already throws a
check the exception, if the birthdate isn't passable.
Now we need to quality control our methods, starting with set name, the colour should not be allowed
to update an object with a name that is another blank.
So if the name that was passed in is null or blank.
You'll throw an exception.
Same thing for the phone number, we'll throw an exception if they enter a number that is null or blank.
We'll throw another one if the length of the phone number they pass down is less than five characters.
In which case, we'll throw a new exception.
Phone number cannot be less than five characters.
And inside birthday, there's nothing to really do because if the color were to pass in an invalid birth
date, the method would throw a pass exception.
Now you can feel free to test the exceptions by passing in wrongful values, just like we did in the
vending machine app.
But I'm going to wrap it up right here and move on to part four.