@Test public void testConditional() { System.out.println("EL"); HeaderProcessor<EntityF> instance = new HeaderProcessor(EntityF.class); EntityF testClass = new EntityF(); List<String> headerValues = instance.getLinkHeaderValues(testClass, mockUriInfo, mockRmc); assertEquals(1, headerValues.size()); String headerValue = headerValues.get(0); assertEquals("</application/resources/1>", headerValue); }
List<String> getLinkHeaderValues(Object entity, UriInfo uriInfo, ResourceMappingContext rmc) { final List<Object> matchedResources = uriInfo.getMatchedResources(); if (!matchedResources.isEmpty()) { final Object resource = matchedResources.get(0); final List<String> headerValues = new ArrayList<>(); for (LinkHeaderDescriptor desc : instanceDescriptor.getLinkHeaders()) { if (ELLinkBuilder.evaluateCondition(desc.getCondition(), entity, resource, entity)) { String headerValue = getLinkHeaderValue(desc, entity, resource, uriInfo, rmc); headerValues.add(headerValue); } } return headerValues; } return Collections.emptyList(); }
HeaderProcessor { List<String> getLinkHeaderValues(Object entity, UriInfo uriInfo, ResourceMappingContext rmc) { final List<Object> matchedResources = uriInfo.getMatchedResources(); if (!matchedResources.isEmpty()) { final Object resource = matchedResources.get(0); final List<String> headerValues = new ArrayList<>(); for (LinkHeaderDescriptor desc : instanceDescriptor.getLinkHeaders()) { if (ELLinkBuilder.evaluateCondition(desc.getCondition(), entity, resource, entity)) { String headerValue = getLinkHeaderValue(desc, entity, resource, uriInfo, rmc); headerValues.add(headerValue); } } return headerValues; } return Collections.emptyList(); } }
HeaderProcessor { List<String> getLinkHeaderValues(Object entity, UriInfo uriInfo, ResourceMappingContext rmc) { final List<Object> matchedResources = uriInfo.getMatchedResources(); if (!matchedResources.isEmpty()) { final Object resource = matchedResources.get(0); final List<String> headerValues = new ArrayList<>(); for (LinkHeaderDescriptor desc : instanceDescriptor.getLinkHeaders()) { if (ELLinkBuilder.evaluateCondition(desc.getCondition(), entity, resource, entity)) { String headerValue = getLinkHeaderValue(desc, entity, resource, uriInfo, rmc); headerValues.add(headerValue); } } return headerValues; } return Collections.emptyList(); } HeaderProcessor(Class<T> c); }
HeaderProcessor { List<String> getLinkHeaderValues(Object entity, UriInfo uriInfo, ResourceMappingContext rmc) { final List<Object> matchedResources = uriInfo.getMatchedResources(); if (!matchedResources.isEmpty()) { final Object resource = matchedResources.get(0); final List<String> headerValues = new ArrayList<>(); for (LinkHeaderDescriptor desc : instanceDescriptor.getLinkHeaders()) { if (ELLinkBuilder.evaluateCondition(desc.getCondition(), entity, resource, entity)) { String headerValue = getLinkHeaderValue(desc, entity, resource, uriInfo, rmc); headerValues.add(headerValue); } } return headerValues; } return Collections.emptyList(); } HeaderProcessor(Class<T> c);  }
HeaderProcessor { List<String> getLinkHeaderValues(Object entity, UriInfo uriInfo, ResourceMappingContext rmc) { final List<Object> matchedResources = uriInfo.getMatchedResources(); if (!matchedResources.isEmpty()) { final Object resource = matchedResources.get(0); final List<String> headerValues = new ArrayList<>(); for (LinkHeaderDescriptor desc : instanceDescriptor.getLinkHeaders()) { if (ELLinkBuilder.evaluateCondition(desc.getCondition(), entity, resource, entity)) { String headerValue = getLinkHeaderValue(desc, entity, resource, uriInfo, rmc); headerValues.add(headerValue); } } return headerValues; } return Collections.emptyList(); } HeaderProcessor(Class<T> c);   }