Package com.tick42.glue.desktop.intents

# Class IntentTarget

java.lang.Object
com.tick42.glue.desktop.intents.IntentTarget

    public final class IntentTarget
    extends Object

Target of the raised intent.

Since:
  1.4.1
See Also:
  `IntentRequest.Builder.withTarget(IntentTarget)`

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `static IntentTarget` | `application​(String application)` | Returns an `IntentTarget` that will start a new instance of a specific Intent handler application.
  `Optional<String>` | `getApplication()` |
  `Optional<String>` | `getInstance()` |
  `static IntentTarget` | `instance​(String instance)` | Returns an `IntentTarget` that will reuse a specific instance of an Intent handler.
  `boolean` | `isApplication()` |
  `boolean` | `isInstance()` |
  `boolean` | `isReuse()` |
  `boolean` | `isStartNew()` |
  `static IntentTarget` | `reuse()` | Returns an `IntentTarget` that will try to reuse first available running (i.e.
  `static IntentTarget` | `startNew()` | Returns an `IntentTarget` that will start a new application instance of the first available `IntentHandler`.
  `String` | `toString()` | Returns the `String` representation for this target.

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

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

- ## Method Details

  - ### startNew

    public static IntentTarget startNew()
    Returns an `IntentTarget` that will start a new application instance of the first available `IntentHandler`.
    Returns:
      `IntentTarget` that will start a new application instance, never `null`

  - ### reuse

    public static IntentTarget reuse()
    Returns an `IntentTarget` that will try to reuse first available running (i.e. of type `IntentHandlerType.INSTANCE`) `IntentHandler` instance. Will fallback to startNew if there are no running instances available.
    Returns:
      `IntentTarget` that will try to reuse a running application instance, never `null`

  - ### application

    public static IntentTarget application​(String application)
    Returns an `IntentTarget` that will start a new instance of a specific Intent handler application.
    Parameters:
      `application` - application name, must not be `null`
    Returns:
      `IntentTarget` that will start a new instance of specific application, never `null`

  - ### instance

    public static IntentTarget instance​(String instance)
    Returns an `IntentTarget` that will reuse a specific instance of an Intent handler.
    Parameters:
      `instance` - instance id, must not be `null`
    Returns:
      `IntentTarget` that will to reuse a specific running application instance, never `null`
    See Also:
      `IntentHandler.getInstanceId()`

  - ### isStartNew

    public boolean isStartNew()

  - ### isReuse

    public boolean isReuse()

  - ### isApplication

    public boolean isApplication()

  - ### isInstance

    public boolean isInstance()

  - ### getApplication

    public Optional<String> getApplication()

  - ### getInstance

    public Optional<String> getInstance()

  - ### toString

    public String toString()
    Returns the `String` representation for this target.
    Overrides:
      `toString` in class `Object`
    Returns:
      the `String` representation for this target, never `null`.