# Class: GroupObject

## helma.Group.GroupObject(Instance)

This class wraps the java GroupObject and provides several methods for retrieving and manipulating properties.

## Constructor

#### new GroupObject(Instance)

Constructs a new helma.Group.GroupObject.

##### Parameters:

Name | Type | Description
--- | --- | ---
`Instance` | Object | of helma.extensions.helmagroups.GroupObject

Source:
  - helma/Group.js, line 143

### Members

#### (static) GET_FIRST

Static properties of GroupObject constructor function. These values determine if and for how many confirmation of the group members this instance waits after a modification. These values are passed through to org.jgroups.blocks.GroupRequest, for further comments see the sourcecode of that class

Source:
  - helma/Group.js, line 567

### Methods

#### countChildren()

Returns the number of child GroupObjects

Source:
  - helma/Group.js, line 522

##### Returns:

The number of child GroupObjects of this helma.Group.GroupObject instance

#### countProperties()

Returns the number of properties of this GroupObject

Source:
  - helma/Group.js, line 536

##### Returns:

The number of properties

#### get(key)

Returns either a property or a child GroupObject from this GroupObject instance. The key passed as argument may be a String, an Array containing Strings or a String containing separator characters ("/"). In the latter two cases the argument is considered a path and the function walks down that path to find the requested GroupObject.

##### Parameters:

Name | Type | Description
--- | --- | ---

`key`

Object

Either

- a String
- a String containing slashes
- an Array containing String keys

Source:
  - helma/Group.js, line 379

##### Returns:

Depending on the argument either the appropriate property value or a helma.Group.GroupObject

#### getJavaObject()

Returns the wrapped java GroupObject.

Source:
  - helma/Group.js, line 254

##### Returns:

Instance of helma.extensions.helmagroups.GroupObject;

#### getProperty(key)

Gets a property from this GroupObject. The key passed as argument is always considered a property even if it contains a slash. This is actually a workaround for the fact that other instances of the group not using the javascript extension aren't forbidden to add properties containing a slash in the property's name. So, using this extension we can at least read the property.

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | String | The name of the property to return

Source:
  - helma/Group.js, line 417

##### Returns:

The value of the property

#### isLocal()

Returns true if the GroupObject is not replicated

Source:
  - helma/Group.js, line 546

##### Returns:

True if this GroupObject is still local

#### listChildren()

Returns an Array containing all child GroupObjects

Source:
  - helma/Group.js, line 492

##### Returns:

An Array containing GroupObjects

#### listProperties()

Returns an Array containing all property names of this GroupObject instance

Source:
  - helma/Group.js, line 507

##### Returns:

An Array containing property names

#### remove(key, The)

Removes a property or a child GroupObject from this instance. The Key may be a String, an Array or a String with separator characters ("/"). In the latter two cases the argument is considered a path and the function walks down that path to find the GroupObject and deletes it.

##### Parameters:

Name | Type | Description
--- | --- | ---

`key`

Object

Either

- a String
- a String containing slashes
- an Array containing String keys

`The` | Number | mode to use when committing the change to the helma.Group

Source:
  - helma/Group.js, line 344

#### set(key, The, The)

Sets a property or a child GroupObject in this instance. The Key may be a String, an Array or a String with separator characters ("/"). In the latter two cases the argument is considered a path and all GroupObjects along this path are created if necessary.

##### Parameters:

Name | Type | Description
--- | --- | ---

`key`

Object

Either

- a String
- a String containing slashes
- an Array containing String keys

`The` | Number | value to set the property to.
`The` | Object | mode to use when committing the change to the helma.Group

Source:
  - helma/Group.js, line 274

#### toJSObject()

Converts this GroupObject into a vanilla Object

Source:
  - helma/Group.js, line 477

##### Returns:

An Object containing all properties of this GroupObject

#### unwrap()

Clones this GroupObject and returns it. This method should be considered if many properties of a GroupObject must be set or modified since every change to an already replicated GroupObject will result in immediate network traffic. Using unwrap one can modify several properties and then commit the GroupObject at once using {@link #wrap).

Source:
  - helma/Group.js, line 464

##### Returns:

A clone of this GroupObject

#### wrap(The)

Exchanges this GroupObject with the one passed as argument. This is done by exchanging the wrapped instance of helma.extensions.helmagroups.GroupObject

##### Parameters:

Name | Type | Description
--- | --- | ---
`The` | GroupObject | GroupObject to use

Source:
  - helma/Group.js, line 441

##### Returns:

The GroupObject with the exchanged wrapped java object

#### (inner) checkWriteAccess()

private method that returns true if the group is writable

Source:
  - helma/Group.js, line 155

##### Returns:

Boolean

#### (inner) createPath()

if key is a path, walks through the path and returns the lowest GroupObject. if tree ends somewhere in the path, function creates the missing GroupObjects.

Source:
  - helma/Group.js, line 226

##### Returns:

helma.Group.GroupObject

#### (inner) getLastKeyElement()

Returns the last element if the key passed as argument is a path.

Source:
  - helma/Group.js, line 179

##### Returns:

Boolean

#### (inner) keyIsPath()

Checks if the key passed as argument is a path (either an Array or a String that contains separator characters)

Source:
  - helma/Group.js, line 167

##### Returns:

Boolean

#### (inner) walkPath()

if key is a path, walks through the path and returns the lowest GroupObject. if tree ends somewhere in the path, function returns null.

Source:
  - helma/Group.js, line 199

##### Returns:

null or GroupObject