classafBeanUtils::BeanProperties

sys::Obj
  afBeanUtils::BeanProperties

Does its best attempt to complete the action, be it creating classes along the way, coercing strings to types

Static typing, all Maps, Lists and methods must be correctly defined with return types

Can't use -> dynamic calls as need to know if it's field or a method

call

Source

static Obj? call(Obj instance, Str property, Obj?[]? args := null)

Similar to get() but may read better in code if you know the expression ends with a method.

Any arguments given overwrite arguments in the expression. Example:

BeanProperties.call(Buf(), "fill(255, 4)", [128, 2])  // --> 0x8080
get

Source

static Obj? get(Obj instance, Str property)

Gets the value of the field (or method) at the end of the property expression.

set

Source

static Void set(Obj instance, Str property, Obj? value)

Sets the value of the field at the end of the property expression.

setAll

Source

static Obj setAll(Obj instance, Str:Obj? propertyValues)

Given a map of values, keyed by property expressions, this sets them on the given instance.

Returns the given instance.