[Java] Class MetaArrayLengthProperty
- groovy.lang.MetaArrayLengthProperty
Represents the length property of an array
- Authors:
- James Strachan
| Fields inherited from class | Fields |
|---|---|
class MetaProperty | PROPERTY_SET_PREFIX, name, type |
Constructor Summary
| Constructor and description |
|---|
MetaArrayLengthProperty
()Sole constructor setting name to "length" and type to int |
Methods Summary
| Type Params | Return Type | Name and description |
|---|---|---|
Object |
getProperty(Object object)Get this property from the given object. | |
void |
setProperty(Object object, Object newValue)Sets the property on the given object to the new value |
Inherited Methods Summary
| Methods inherited from class | Name |
|---|---|
class MetaProperty | getGetterName, getModifiers, getName, getProperty, getSetterName, getType, setProperty |
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail
public MetaArrayLengthProperty()
Sole constructor setting name to "length" and type to int
Method Detail
public Object getProperty(Object object)
Get this property from the given object.
- throws:
- IllegalArgumentException if object is not an array
- Parameters:
-
object- an array
- Returns:
- the length of the array object
public void setProperty(Object object, Object newValue)
Sets the property on the given object to the new value
- throws:
- RuntimeException if the property could not be set
- Parameters:
-
object- on which to set the property -
newValue- the new value of the property
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.4.21/html/gapi/groovy/lang/MetaArrayLengthProperty.html