package org.realityforge.replicant.example.server.service.tyrell.replicate;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.enterprise.context.Dependent;
import org.realityforge.replicant.example.server.entity.tyrell.Building;
import org.realityforge.replicant.example.server.entity.tyrell.Room;
import org.realityforge.replicant.example.server.entity.tyrell.TyrellRouter;

@Dependent
public class EntityRouter
  implements TyrellRouter
{
  public static final String BUILDING_KEY = "Tyrell.BuildingID";

  @Nonnull
  @Override
  public Map<String, Serializable> routeBuilding( @Nonnull final Building entity )
  {
    final HashMap<String, Serializable> map = new HashMap<>();
    map.put( BUILDING_KEY, entity.getID() );
    return map;
  }

  @Nonnull
  @Override
  public Map<String, Serializable> routeRoom( @Nonnull final Room entity )
  {
    return routeBuilding( entity.getBuilding() );
  }
}

@@ -223,16 +223,86 @@
 endent;%0A
+import org.realityforge.replicant.example.server.entity.TyrellRouter;%0A
 import o
@@ -438,85 +438,8 @@
 oom;
-%0Aimport org.realityforge.replicant.example.server.entity.tyrell.TyrellRouter;
 %0A%0A@D

Upgrade to the new Domgen API