mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Add golden files for request component routing maps
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=157026188
This commit is contained in:
parent
bb67841884
commit
ddb0f5692e
23 changed files with 514 additions and 39 deletions
|
@ -65,8 +65,7 @@ final class Router {
|
|||
return Optional.absent();
|
||||
}
|
||||
|
||||
private static
|
||||
ImmutableSortedMap<String, Route> extractRoutesFromComponent(Class<?> componentClass) {
|
||||
static ImmutableSortedMap<String, Route> extractRoutesFromComponent(Class<?> componentClass) {
|
||||
ImmutableSortedMap.Builder<String, Route> routes =
|
||||
new ImmutableSortedMap.Builder<>(Ordering.natural());
|
||||
for (Method method : componentClass.getMethods()) {
|
||||
|
@ -79,9 +78,12 @@ final class Router {
|
|||
if (action == null) {
|
||||
continue;
|
||||
}
|
||||
@SuppressWarnings("unchecked") // Safe due to previous checks.
|
||||
@SuppressWarnings("unchecked") // Safe due to previous checks.
|
||||
Route route =
|
||||
Route.create(action, (Function<Object, Runnable>) newInstantiator(method));
|
||||
Route.create(
|
||||
action,
|
||||
(Function<Object, Runnable>) newInstantiator(method),
|
||||
method.getReturnType());
|
||||
routes.put(action.path(), route);
|
||||
}
|
||||
return routes.build();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue