Enum Class EventCategory

java.lang.Object
java.lang.Enum<EventCategory>
io.hypersistence.optimizer.core.event.persistence.EventCategory
All Implemented Interfaces:
Serializable, Comparable<EventCategory>, Constable

public enum EventCategory extends Enum<EventCategory>
The EventCategory classifies an Event based on the phase during which it is emitted, so that configuration and mapping events (detected once, at bootstrap) can be told apart from runtime events (emitted continuously while the application runs).

The classification is based on the fully qualified name of the Event class, so it does not require a compile-time dependency on every concrete event type.

Since:
2.14.0
Author:
Vlad Mihalcea
  • Enum Constant Details

    • CONFIGURATION

      public static final EventCategory CONFIGURATION
      Configuration-related events, detected when scanning the JPA/Hibernate configuration.
    • MAPPING

      public static final EventCategory MAPPING
      Mapping-related events, detected when scanning the entity mappings.
    • RUNTIME

      public static final EventCategory RUNTIME
      Runtime events, emitted while the application is executing (e.g. slow queries, N+1 issues).
  • Method Details

    • values

      public static EventCategory[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static EventCategory valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static EventCategory of(Event event)
      Resolve the EventCategory of the provided Event.
      Parameters:
      event - the Event to classify
      Returns:
      the EventCategory of the provided Event