# Class DefaultEvent

Object
AbstractMetadata
ModifiableMetadata
ISOMetadata
DefaultEvent

All Implemented Interfaces:
  `Serializable`, `Emptiable`, `LenientComparable`, `IdentifiedObject`, `Event`

public class DefaultEvent extends ISOMetadata implements Event
Identification of a significant collection point within an operation. The following properties are mandatory in a well-formed metadata according ISO 19115:
`MI_Event` `├─identifier……` Event name or number. `│ └─code…………` Alphanumeric value identifying an instance in the namespace. `├─trigger……………` Initiator of the event. `├─context……………` Meaning of the event. `├─sequence…………` Relative time ordering of the event. `└─time……………………` Time the event occurred.

## Limitations

- Instances of this class are not synchronized for multi-threading. Synchronization, if needed, is caller's responsibility.
- Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases. Serialization support is appropriate for short term storage or RMI between applications running the same version of Apache SIS. For long term storage, use `XML` instead.

Since:
  0.3
See Also:
  - Serialized Form

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class ModifiableMetadata

  `ModifiableMetadata​.State`

- ## Field Summary

  ### Fields inherited from class ISOMetadata

  `identifiers`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultEvent()`
  Constructs an initially empty acquisition information.
  `DefaultEvent(Event object)`
  Constructs a new instance initialized with the values from the specified metadata object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static DefaultEvent`
  `castOrCopy(Event object)`
  Returns a SIS metadata implementation with the values of the given arbitrary implementation.
  `Context`
  `getContext()`
  Meaning of the event.
  `Temporal`
  `getDateOfOccurrence()`
  Returns the time the event occurred.
  `Collection<Objective>`
  `getExpectedObjectives()`
  Returns the objective or objectives satisfied by an event.
  `Identifier`
  `getIdentifier()`
  Returns the event name or number.
  `PlatformPass`
  `getRelatedPass()`
  Returns the pass during which an event occurs.
  `Collection<? extends Instrument>`
  `getRelatedSensors()`
  Returns the instrument or instruments for which the event is meaningful.
  `Sequence`
  `getSequence()`
  Returns the relative time ordering of the event.
  `Date`
  `getTime()`
  Deprecated.
  Replaced by `getDateOfOccurrence()`.
  `Trigger`
  `getTrigger()`
  Returns the initiator of the event.
  `void`
  `setContext(Context newValue)`
  Sets the meaning of the event.
  `void`
  `setDateOfOccurrence(Temporal newValue)`
  Sets the date and/or time the event occurred.
  `void`
  `setExpectedObjectives(Collection<? extends Objective> newValues)`
  Sets the objective or objectives satisfied by an event.
  `void`
  `setIdentifier(Identifier newValue)`
  Sets the event name or number.
  `void`
  `setRelatedPass(PlatformPass newValue)`
  Sets the pass during which an event occurs.
  `void`
  `setRelatedSensors(Collection<? extends Instrument> newValues)`
  Sets the instrument or instruments for which the event is meaningful.
  `void`
  `setSequence(Sequence newValue)`
  Sets the relative time ordering of the event.
  `void`
  `setTime(Date newValue)`
  Deprecated.
  Replaced by `setDateOfOccurrence(Temporal)`.
  `void`
  `setTrigger(Trigger newValue)`
  Sets the initiator of the event.

  ### Methods inherited from class ISOMetadata

  `getIdentifierMap, getIdentifiers, getStandard`

  ### Methods inherited from class ModifiableMetadata

  `checkWritePermission, collectionType, copyCollection, copyList, copyMap, copySet, deepCopy, nonNullCollection, nonNullList, nonNullMap, nonNullSet, singleton, state, writeCollection, writeList, writeMap, writeSet`

  ### Methods inherited from class AbstractMetadata

  `asMap, asTreeTable, clone, equals, equals, getInterface, hashCode, isEmpty, nilReasons, prune, toString`

  ### Methods inherited from class Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DefaultEvent

    public DefaultEvent()
    Constructs an initially empty acquisition information.

  - ### DefaultEvent

    public DefaultEvent(Event object)
    Constructs a new instance initialized with the values from the specified metadata object. This is a shallow copy constructor, because the other metadata contained in the given object are not recursively copied.
    Parameters:
      `object` - the metadata to copy values from, or `null` if none.
    See Also:
      - `castOrCopy(Event)`

- ## Method Details

  - ### castOrCopy

    public static DefaultEvent castOrCopy(Event object)
    Returns a SIS metadata implementation with the values of the given arbitrary implementation. This method performs the first applicable action in the following choices:
    - If the given object is `null`, then this method returns `null`.
    - Otherwise if the given object is already an instance of `DefaultEvent`, then it is returned unchanged.
    - Otherwise a new `DefaultEvent` instance is created using the copy constructor and returned. Note that this is a shallow copy operation, because the other metadata contained in the given object are not recursively copied.
    Parameters:
      `object` - the object to get as a SIS implementation, or `null` if none.
    Returns:
      a SIS implementation containing the values of the given object (may be the given object itself), or `null` if the argument was null.

  - ### getIdentifier

    public Identifier getIdentifier()
    Returns the event name or number.
    Specified by:
      `getIdentifier` in interface `Event`
    Overrides:
      `getIdentifier` in class `ISOMetadata`
    Returns:
      event name or number, or `null`.

  - ### setIdentifier

    public void setIdentifier(Identifier newValue)
    Sets the event name or number.
    Overrides:
      `setIdentifier` in class `ISOMetadata`
    Parameters:
      `newValue` - the event identifier value.

  - ### getTrigger

    public Trigger getTrigger()
    Returns the initiator of the event.
    Specified by:
      `getTrigger` in interface `Event`
    Returns:
      initiator of the event, or `null`.

  - ### setTrigger

    public void setTrigger(Trigger newValue)
    Sets the initiator of the event.
    Parameters:
      `newValue` - the new trigger value.

  - ### getContext

    public Context getContext()
    Meaning of the event.
    Specified by:
      `getContext` in interface `Event`
    Returns:
      meaning of the event, or `null`.

  - ### setContext

    public void setContext(Context newValue)
    Sets the meaning of the event.
    Parameters:
      `newValue` - the new context value.

  - ### getSequence

    public Sequence getSequence()
    Returns the relative time ordering of the event.
    Specified by:
      `getSequence` in interface `Event`
    Returns:
      relative time ordering, or `null`.

  - ### setSequence

    public void setSequence(Sequence newValue)
    Sets the relative time ordering of the event.
    Parameters:
      `newValue` - the new sequence value.

  - ### getTime

    @Deprecated(since="1.5") public Date getTime()
    Deprecated.
    Replaced by `getDateOfOccurrence()`.
    Returns the time the event occurred.
    Specified by:
      `getTime` in interface `Event`
    Returns:
      time the event occurred, or `null`.

  - ### setTime

    @Deprecated(since="1.5") public void setTime(Date newValue)
    Deprecated.
    Replaced by `setDateOfOccurrence(Temporal)`.
    Sets the time the event occurred.
    Parameters:
      `newValue` - the new time value.

  - ### getDateOfOccurrence

    @UML(identifier="time", obligation=MANDATORY, specification=ISO_19115_2) public Temporal getDateOfOccurrence()
    Returns the time the event occurred.
    Returns:
      time the event occurred, or `null`.
    Since:
      1.5

  - ### setDateOfOccurrence

    public void setDateOfOccurrence(Temporal newValue)
    Sets the date and/or time the event occurred.
    Parameters:
      `newValue` - the new time value.
    Since:
      1.5

  - ### getExpectedObjectives

    public Collection<Objective> getExpectedObjectives()
    Returns the objective or objectives satisfied by an event.
    Specified by:
      `getExpectedObjectives` in interface `Event`
    Returns:
      objectives satisfied by an event.

  - ### setExpectedObjectives

    public void setExpectedObjectives(Collection<? extends Objective> newValues)
    Sets the objective or objectives satisfied by an event.
    Parameters:
      `newValues` - the new expected objectives values.

  - ### getRelatedPass

    public PlatformPass getRelatedPass()
    Returns the pass during which an event occurs. `null` if unspecified.
    Specified by:
      `getRelatedPass` in interface `Event`
    Returns:
      pass during which an event occurs, or `null`.

  - ### setRelatedPass

    public void setRelatedPass(PlatformPass newValue)
    Sets the pass during which an event occurs.
    Parameters:
      `newValue` - the new platform pass value.

  - ### getRelatedSensors

    public Collection<? extends Instrument> getRelatedSensors()
    Returns the instrument or instruments for which the event is meaningful.
    Specified by:
      `getRelatedSensors` in interface `Event`
    Returns:
      instruments for which the event is meaningful.

  - ### setRelatedSensors

    public void setRelatedSensors(Collection<? extends Instrument> newValues)
    Sets the instrument or instruments for which the event is meaningful.
    Parameters:
      `newValues` - the new instrument values.