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