[Java] Class MetaArrayLengthProperty
- groovy.lang.MetaArrayLengthProperty
public class MetaArrayLengthProperty extends MetaProperty
Represents the length property of an array
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 |
---|---|---|
public Object |
getProperty(Object object) Get this property from the given object. | |
public 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 |
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/3.0.7/html/gapi/groovy/lang/MetaArrayLengthProperty.html