Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JXVi2GMQ7bR5EmbUFdDj7N
23 lines
568 B
Java
23 lines
568 B
Java
package com.ankurm.gateway;
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/** Maps a model hint to an ordered list of targets. An unknown hint is an error, not a default. */
|
|
public final class Routes {
|
|
|
|
private final Map<String, List<Target>> table;
|
|
|
|
public Routes(Map<String, List<Target>> table) {
|
|
this.table = Map.copyOf(table);
|
|
}
|
|
|
|
public List<Target> get(String hint) {
|
|
List<Target> t = table.get(hint);
|
|
if (t == null) {
|
|
throw new UnknownHintException(hint, table.keySet());
|
|
}
|
|
return t;
|
|
}
|
|
}
|