Record Class NavigationJSentinelContext

java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.authorization.navigation.NavigationJSentinelContext
Record Components:
navigationTarget - the class being navigated to
restricted - whether the target carries a restriction annotation
subjectAvailable - whether a security subject exists in the current session
isLoginTarget - whether the target is the login view itself

public record NavigationJSentinelContext(Class<?> navigationTarget, boolean restricted, boolean subjectAvailable, boolean isLoginTarget) extends Record
Vaadin-free context for making navigation security decisions.

This record captures the relevant facts about a navigation event without depending on any Vaadin types. The Vaadin listener builds this context from the BeforeEnterEvent and passes it to NavigationAccessDecisionService.

  • Constructor Details

    • NavigationJSentinelContext

      public NavigationJSentinelContext(Class<?> navigationTarget, boolean restricted, boolean subjectAvailable, boolean isLoginTarget)
      Creates an instance of a NavigationJSentinelContext record class.
      Parameters:
      navigationTarget - the value for the navigationTarget record component
      restricted - the value for the restricted record component
      subjectAvailable - the value for the subjectAvailable record component
      isLoginTarget - the value for the isLoginTarget record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • restricted

      public boolean restricted()
      Returns the value of the restricted record component.
      Returns:
      the value of the restricted record component
    • subjectAvailable

      public boolean subjectAvailable()
      Returns the value of the subjectAvailable record component.
      Returns:
      the value of the subjectAvailable record component
    • isLoginTarget

      public boolean isLoginTarget()
      Returns the value of the isLoginTarget record component.
      Returns:
      the value of the isLoginTarget record component