Package org.daiitech.naftah.builtin.lang
Class None
java.lang.Object
org.daiitech.naftah.builtin.lang.None
this class represents a singleton value indicating the absence of a value.
This is similar to null in Java, but it's implemented
as a safe, immutable object to avoid NullPointerExceptions.
Used to represent "no value" in expression evaluations or logic operations.
- Author:
- Chakib Daii
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNone()Private constructor to prevent external instantiation. -
Method Summary
-
Field Details
-
INSTANCE
The singleton instance ofNone.
-
-
Constructor Details
-
None
private None()Private constructor to prevent external instantiation.
-
-
Method Details
-
get
Returns the singleton instance representingNone.- Returns:
- the
Noneinstance
-
isNone
Checks whether the given object is theNoneinstance.- Parameters:
object- the object to check- Returns:
trueif the object isNone;falseotherwise
-
toString
Returns the string representation of thisNoneobject.
-