Package pro.tyshchenko.nullhater
Class EmptyRef
java.lang.Object
pro.tyshchenko.nullhater.EmptyRef
- Author:
- Alexander Tyshchenko
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
EmptyRef
public EmptyRef()
-
-
Method Details
-
justEmpty
public static <T> T justEmpty()Some situation
UsageObject value = null; // here in as Object can be any class // you always need to assign with null reference // of course you can use Optional.ofNullable(), but exist situations // when you need to use just reference and you truly OOP guy that hate // null reference in code if (some condition) { value = ... some value } else if (some condition) { value = ... some value }Object value = justEmpty();- Type Parameters:
T-- Returns:
- wrapped null reference
-