Interface EnumWithStableIndex

All Known Implementing Classes:
AuthenticationExecutionModel.Requirement, CommonClientSessionModel.ExecutionStatus, DecisionStrategy, EventType, Logic, OperationType, PolicyEnforcementMode, UserSessionModel.State

public interface EnumWithStableIndex
Classes implementing this interface guarantee that for each instance of this class, there exists an mutually unique integer which is stable in time, and identifies always the same instance of this class. The index might be used for persistence, hence the index of a particular item cannot be changed. This is mostly usable for @{code enum}s.
  • Method Details

    • getStableIndex

      int getStableIndex()
      Unique numeric index which is stable in time and identifies an instance. Reusing the same index for two distinct entries of the same class is forbidden even if they cannot exist at the same time (e.g. one is deleted before other is introduced).
    • getReverseIndex

      static <E extends EnumWithStableIndex> Map<Integer,E> getReverseIndex(E[] values)