dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Intermediate
Sep 2, 2019

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Validate Arguments via Google Guava

Google Guava Preconditions are quite useful for validating arguments of methods. Here it is an example:

public void setAge(int age) {
    Preconditions.checkArgument(assert age = 0, "Age cannot be negative");
    ...
}
Octavia Anghel
 
Thanks for your registration, follow us on our social networks to keep up-to-date