# InstallerEvent

Import: `import com.install4j.api.events.InstallerEvent;`

```java
public class InstallerEvent extends EventObject
```

The event object that is passed to installer event listeners.
Event listeners are registered in the [`InstallerContext`](../context/InstallerContext.md).


**See also:**

- [InstallerEventListener](InstallerEventListener.md)
- [InstallerContext.addInstallerEventListener](../context/InstallerContext.md#addinstallereventlistener-installereventlistener)

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getType()`](#gettype) | `EventType` | Get the type of the event. |
| [`getContext()`](#getcontext) | `Context` | Get the context. |
| [`setContext(Context)`](#setcontext-context) | `void` |  |
| [`wasSuccessful()`](#wassuccessful) | `boolean` | Return whether the operation associated with the event was successful |
| [`toString()`](#tostring) | `String` |  |
| [`getVerbose()`](#getverbose) | `String` | Return a verbose description of this event. |

### getType()

```java
public EventType getType()
```

Get the type of the event.


**Returns:** the type

### getContext()

```java
public Context getContext()
```

Get the context.


**Returns:** the context.

### setContext(Context)

```java
public void setContext(Context context)
```

### wasSuccessful()

```java
public boolean wasSuccessful()
```

Return whether the operation associated with the event was successful


**Returns:** `true` or `false`.

### toString()

```java
public String toString()
```

### getVerbose()

```java
public String getVerbose()
```

Return a verbose description of this event.


**Returns:** the description

## Constructors

| Signature | Description |
|---|---|
| [`InstallerEvent(Object, Context, EventType, boolean)`](#installerevent-object-context-eventtype-boolean) | The constructor is called by the framework. |
| [`InstallerEvent(Object, Context, EventType)`](#installerevent-object-context-eventtype) | The constructor is called by the framework. |

### InstallerEvent(Object, Context, EventType, boolean)

```java
public InstallerEvent(Object source, Context context, EventType type, boolean success)
```

The constructor is called by the framework.


**Parameters:**

- `source` — the event source
- `context` — the context
- `type` — the event type.
- `success` — whether the operation associated with the event was successful

### InstallerEvent(Object, Context, EventType)

```java
public InstallerEvent(Object source, Context context, EventType type)
```

The constructor is called by the framework.


**Parameters:**

- `source` — the event source
- `context` — the context
- `type` — the event type.

