java.lang.Object
de.espirit.firstspirit.client.plugin.dataaccess.aspects.SessionAspectMap

public final class SessionAspectMap extends Object
Map for keeping session aspects in a type safe manner.
Since:
5.2.5
  • Constructor Details

    • SessionAspectMap

      public SessionAspectMap()
  • Method Details

    • put

      public final <A, C extends A> void put(@NotNull @NotNull SessionAspectType<A> type, @NotNull C aspect)
      Put an aspect for specific type.
      Type Parameters:
      A - The type of the aspect.
      C - The concrete implementation type of the aspect.
      Parameters:
      type - The aspect type.
      aspect - The aspect implementation.
      Since:
      5.2.5
    • remove

      public final void remove(SessionAspectType<?> type)
      Remove the aspect for the given type from this map.
      Parameters:
      type - The aspect type.
      Since:
      5.2.5
    • get

      @Nullable public final <A> A get(SessionAspectType<A> type)
      Get the correctly typed aspect for a type.
      Type Parameters:
      A - The type of the aspect.
      Parameters:
      type - The aspect type to look up.
      Returns:
      The aspect implementation.
      Since:
      5.2.5