class OrganizationLinksInjector {

  public OrganizationDto injectLinks(
      OrganizationDto organizationDto, ServiceContext serviceContext) {
    final UriBuilder uriBuilder = serviceContext.getBaseUriBuilder();
    final List<Link> links = new ArrayList<>(2);
    links.add(
        LinksHelper.createLink(
            HttpMethod.GET,
            uriBuilder
                .clone()
                .path(OrganizationService.class)
                .path(OrganizationService.class, "getById")
                .build(organizationDto.getId())
                .toString(),
            null,
            APPLICATION_JSON,
            Constants.LINK_REL_SELF));
    links.add(
        LinksHelper.createLink(
            HttpMethod.GET,
            uriBuilder
                .clone()
                .path(OrganizationService.class)
                .path(OrganizationService.class, "getByParent")
                .build(organizationDto.getId())
                .toString(),
            null,
            APPLICATION_JSON,
            Constants.LINK_REL_SUBORGANIZATIONS));
    return organizationDto.withLinks(links);
  }

}