Record Class RouteReference

java.lang.Object
java.lang.Record
com.vaadin.flow.router.RouteReference
Record Components:
navigationTarget - the navigation target class
routeParameters - the route parameters to resolve the navigation target with
All Implemented Interfaces:
Serializable

public record RouteReference(Class<? extends Component> navigationTarget, RouteParameters routeParameters) extends Record implements Serializable
A reference to a route, consisting of the navigation target class and the RouteParameters it should be resolved with. It identifies a route regardless of whether the route has a logical parent.

It is returned by a RouteParentResolver to describe a logical parent and is the element type of a resolved breadcrumb trail. The parameters are part of the reference because a parent route typically inherits only a subset of the child parameters (for example orgs/:orgId as the parent of orgs/:orgId/projects/:projectId), and that subset is needed both to resolve the parent's own title and to resolve its parent in turn.

Since:
25.2
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • RouteReference

      public RouteReference(Class<? extends Component> navigationTarget, RouteParameters routeParameters)
      Creates an instance of a RouteReference record class.
      Parameters:
      navigationTarget - the value for the navigationTarget record component
      routeParameters - the value for the routeParameters 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • routeParameters

      public RouteParameters routeParameters()
      Returns the value of the routeParameters record component.
      Returns:
      the value of the routeParameters record component