class CloudFoundryApplicationRoute {

    @JsonIgnore
    public UnmapRouteRequest getUnmapRouteRequest () {
        UnmapRouteRequest.Builder builder = UnmapRouteRequest.builder();
        builder.applicationName(applicationName).domain(domain.getName());
        switch (type) {
            case HTTP:
                return builder.path(path).host(host).build();
            case TCP:
                return builder.port(port).build();
            default:
                throw new ChaosException(CloudFoundryChaosErrorCode.UNSUPPORTED_ROUTE_TYPE);
        }
    }

}