|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovy.lang.GroovyObjectSupport
org.codehaus.groovy.runtime.NullObject
public class NullObject
Method Summary | |
---|---|
boolean |
asBoolean()
A null object always coerces to false. |
java.lang.Object |
asType(java.lang.Class c)
Type conversion method for null. |
java.lang.Object |
clone()
Since this is implemented as a singleton, we should avoid the use of the clone method |
boolean |
equals(java.lang.Object to)
null is only equal to null |
static NullObject |
getNullObject()
get the NullObject reference |
java.lang.Object |
getProperty(java.lang.String property)
Tries to get a property on null, which will always fail |
int |
hashCode()
|
java.lang.Object |
invokeMethod(java.lang.String name,
java.lang.Object args)
Tries to invoke a method on null, which will always fail |
boolean |
is(java.lang.Object other)
The method "is" is used to test for equal references. |
java.util.Iterator |
iterator()
iterator() method to be able to iterate on null. |
java.lang.Object |
plus(java.lang.Object o)
Fallback for null+null. |
java.lang.Object |
plus(java.lang.String s)
Allows to add a String to null. |
void |
setProperty(java.lang.String property,
java.lang.Object newValue)
Tries to set a property on null, which will always fail |
java.lang.String |
toString()
|
Methods inherited from class groovy.lang.GroovyObjectSupport |
---|
getMetaClass, setMetaClass |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static NullObject getNullObject()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.Object getProperty(java.lang.String property)
getProperty
in interface GroovyObject
getProperty
in class GroovyObjectSupport
property
- - the property to get
public void setProperty(java.lang.String property, java.lang.Object newValue)
setProperty
in interface GroovyObject
setProperty
in class GroovyObjectSupport
property
- - the proprty to setnewValue
- - the new value of the propertypublic java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)
invokeMethod
in interface GroovyObject
invokeMethod
in class GroovyObjectSupport
name
- the name of the method to invokeargs
- - arguments to the method
public boolean equals(java.lang.Object to)
equals
in class java.lang.Object
to
- - the reference object with which to compare
public java.util.Iterator iterator()
public java.lang.Object plus(java.lang.String s)
s
- - the String to concatenate
public java.lang.Object plus(java.lang.Object o)
o
- - the Object
public boolean is(java.lang.Object other)
other
- - the object to test
public java.lang.Object asType(java.lang.Class c)
c
- - the class to convert to
public boolean asBoolean()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |