Search in sources :

Example 1 with RouteResource

use of org.cloudfoundry.client.v2.routes.RouteResource in project cf-java-client by cloudfoundry.

the class DefaultRoutes method toRoute.

private static Route toRoute(List<String> applications, String domain, RouteResource resource, Optional<String> service, String space) {
    RouteEntity entity = ResourceUtils.getEntity(resource);
    Route.Builder builder = Route.builder().applications(applications).domain(domain).host(entity.getHost()).id(ResourceUtils.getId(resource)).path(entity.getPath()).space(space);
    service.ifPresent(builder::service);
    return builder.build();
}
Also used : RouteEntity(org.cloudfoundry.client.v2.routes.RouteEntity)

Aggregations

RouteEntity (org.cloudfoundry.client.v2.routes.RouteEntity)1