Route class base

Represents a single HTTP route definition consisting of a path and an HttpMethod.

The Route class is the base abstraction for all HTTP route types, such as GET, POST, PUT, and others, used throughout JetLeaf’s routing system.

Purpose

  • Provides a uniform model for route metadata.
  • Serves as input to router builders or DSL-based registration APIs.
  • Enables reflection and matching against ServerHttpRequest objects.

Example

final route = Route('/api/data', HttpMethod.GET);
print('${route.method} ${route.path}'); // GET /api/data
Implementers

Constructors

Route(String path, HttpMethod method)
Represents a single HTTP route definition consisting of a path and an HttpMethod.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
method HttpMethod
The HTTP method (e.g., GET, POST) that this route responds to.
final
path String
The URI path associated with this route.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited