# Utilities

## Collect

{% code title="Syntax" %}

```
[%objects%]
[%objects% as %javatype%]
```

{% endcode %}

Creates an array containing the specified objects. Specifying a type determines the component type of the resulting array.

{% hint style="info" %}
The brackets in this syntax are literal, not representing an optional group.
{% endhint %}

## Spread

{% code title="Syntax" %}

```
...%object%
```

{% endcode %}

Returns the contents of a single array, iterable, iterator, or stream.

## Array Value

{% code title="Syntax" %}

```
%array%[%integer%]
```

{% endcode %}

Represents the value at a certain index of an array.

This value may be read from and written to.

{% hint style="info" %}
The brackets in this syntax are literal, not representing an optional group.
{% endhint %}

## Null

{% code title="Syntax" %}

```
null
```

{% endcode %}

Represents `null` in Java. This is different from Skript's `<none>`.

## Bits

{% code title="Syntax" %}

```
[the] (bit %number%|bit(s| range) [from] %number%( to |[ ]-[ ])%number%) of %numbers%
%numbers%'[s] (bit %number%|1¦bit(s| range) [from] %number%( to |[ ]-[ ])%number%)
```

{% endcode %}

Represents a subset of bits from a number.

This value may be read from and written to.

## Raw Expression

{% code title="Syntax" %}

```
[the] raw %objects%
```

{% endcode %}

Returns the underlying object of an expression.

## Members

{% code title="Syntax" %}

```
[the] (fields|methods|constructors) of %objects%
%objects%'[s] (fields|methods|constructors)
```

{% endcode %}

Returns a list of the fields, methods, or constructors of an object, including their modifiers and parameters.

If you need a list of field or method names without modifier or parameter details, see [Member Names](#member-names).

## Member Names

{% code title="Syntax" %}

```
[the] (field|method) names of %objects%
%objects%'[s] (field|method) names
```

{% endcode %}

Returns a list of the the fields or methods of an object.

## Is Instance

{% code title="Syntax" %}

```
%objects% (is|are) [a[n]] instance[s] of %javatypes%
%objects% (is not|isn't|are not|aren't) [a[n]] instance[s] of %javatypes%
```

{% endcode %}

Checks whether objects are instances of the given java types.
