Sunday 27 October 2013

Optional in guava

Optional is a way of replacing a nullable T reference with a non-null value. An Optional may either contain a non-null T reference (in which case we say the reference is "present"), or it may contain nothing (in which case we say the reference is "absent"). It is never said to "contain null."

Same concept Optional class is going to be added to the core java.util library in jdk8

More detalails here: https://code.google.com/p/guava-libraries/wiki/UsingAndAvoidingNullExplained

No comments: