org.apache.sling.provisioning.model

## Class ItemList<T>

- java.lang.Object
- - org.apache.sling.provisioning.model.Traceable
  - - org.apache.sling.provisioning.model.Commentable
    - - org.apache.sling.provisioning.model.ItemList<T>

All Implemented Interfaces:
  Iterable<T>

Direct Known Subclasses:
  ArtifactGroup

    public class ItemList<T>
    extends Commentable
    implements Iterable<T>

Helper class to hold a list of items.

### Field Summary

Fields
`protected List<T>` `items` The list holding the items.

### Constructor Summary

Constructors
Constructor and Description
`ItemList()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `add(T item)` Add a new item
`boolean` `isEmpty()` Check if the list is empty.
`Iterator<T>` `iterator()`
`void` `remove(T item)` Remove an item.
`String` `toString()`

### Methods inherited from class org.apache.sling.provisioning.model.Commentable

`getComment, setComment`

### Methods inherited from class org.apache.sling.provisioning.model.Traceable

`getLocation, setLocation`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Field Detail

#### items

    protected final List<T> items

The list holding the items.

### Constructor Detail

#### ItemList

    public ItemList()

### Method Detail

#### add

    public void add(T item)

Add a new item

Parameters:
  `item` - The new item

#### remove

    public void remove(T item)

Remove an item.

Parameters:
  `item` - The item to remove.

#### iterator

    public Iterator<T> iterator()

Specified by:
  `iterator` in interface `Iterable<T>`

#### isEmpty

    public boolean isEmpty()

Check if the list is empty.

Returns:
  `true` if the list is empty.

#### toString

    public String toString()

Overrides:
  `toString` in class `Commentable`