# Legato.Beans.Property

Models a property with type, setter and getter.

Summary

Legato.Beans.Property | Models a property with type, setter and getter.
Properties |
type | {<Legato.Lang.AnyType>} Type of the property.
setter | {Function} Setter function for the property.
getter | {Function} Getter function for the property.
Functions |
initialize | Constructs a new property.
set | Sets value to the given object instance.
get | Gets value from the given object instance.

### Properties

### type

{<Legato.Lang.AnyType>} Type of the property.

### setter

{Function} Setter function for the property.

### getter

{Function} Getter function for the property.

### Functions

### initialize

> initialize : function( | type,
> | setter,
> | getter | )

Constructs a new property.

#### Parameters

type | {<Legato.Lang.AnyType>} type of the property.
setter | {Function} setter function.
getter | {Function} getter function.

### set

> set : function( | instance,
> | value | )

Sets value to the given object instance. Throws {Legato.Lang.Exception} for read-only property.

#### Parameters

instance | instance to set value to.
value | value to be set.

### get

> get : function( | instance | )

Gets value from the given object instance. Throws {Legato.Lang.Exception} for write-only property.

#### Returns

Value of the instance property returned by the getter function.

#### Parameters

instance | instance to set value to.

> initialize : function( | type,
> | setter,
> | getter | )

Constructs a new property.

> set : function( | instance,
> | value | )

Sets value to the given object instance.

> get : function( | instance | )

Gets value from the given object instance.