- @Override
- public RoutingTable copy() {
- RoutingTable copy = new RoutingTable();
- copy.table.putAll(table);
- copy.setRouter(this.getRouter());
+ private RoutingTable(final ActorRef router, final Map<RouteIdentifier<?, ?, ?>, Long> table) {
+ this.router = Preconditions.checkNotNull(router);
+ this.table = Preconditions.checkNotNull(table);
+ }
+
+ RoutingTable(final ActorRef router) {
+ this(router, new HashMap<>());
+ }