| Modifier and Type | Field and Description |
|---|---|
| private static final NullObject |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Object | |
| public Object | Returns: neverOverrides java. |
| public boolean | Returns: true if this object is the same as the to argumentthe reference object with which to compare o)Overrides java. |
| public static NullObject | |
| public Object | Returns: neverthe name of the property of interest name)Overrides default groovy. |
| public int | Returns: neverOverrides java. |
| public Object | Returns: neverthe name of the method to call name, final Object the arguments to use for the method call arguments)Overrides default groovy. |
| public boolean | |
| public Iterator | |
| public Object | |
| public Object | |
| public void | setProperty(final String
the name of the property of interest name, final Object the new value for the property value)Overrides default groovy. |
| public String | |
| public <T> T |
| INSTANCE | back to summary |
|---|---|
| private static final NullObject INSTANCE | |
| NullObject | back to summary |
|---|---|
| private NullObject() | |
| asBoolean | back to summary |
|---|---|
| public boolean asBoolean() A null object coerces to false.
| |
| asType | back to summary |
|---|---|
| public Object asType(final Class<T> c) Type conversion method for null.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Since this is implemented as a singleton, avoid the use of the clone method. | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. null is only equal to null. | |
| getNullObject | back to summary |
|---|---|
| public static NullObject getNullObject() Returns the NullObject reference.
| |
| getProperty | back to summary |
|---|---|
| public Object getProperty(final String name) Overrides default groovy. Tries to get a property on null, which fails.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| invokeMethod | back to summary |
|---|---|
| public Object invokeMethod(final String name, final Object arguments) Overrides default groovy. Tries to invoke a method on null, which falis.
| |
| is | back to summary |
|---|---|
| public boolean is(final Object o) Tests for equal references.
| |
| iterator | back to summary |
|---|---|
| public Iterator Provides ability to iterate on null.
| |
| plus | back to summary |
|---|---|
| public Object plus(final Object o) Fallback for
| |
| plus | back to summary |
|---|---|
| public Object plus(final String s) Allows to add a String to null. The result is concatenated String of the result of calling toString() on this object and the String in the parameter.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(final String name, final Object value) Overrides default groovy. Tries to set a property on null, which fails.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| with | back to summary |
|---|---|
| public <T> T with(final Closure<T> closure) Allows the closure to be called for NullObject.
| |