public Collection<RestfulMapping> getMappingsByHandler(Class<?> handlerClass) { Collection<RestfulMapping> mappings = new LinkedHashSet<RestfulMapping>(); for (RestfulMapping restfulMapping : this.getMappings()) { if (restfulMapping.getBeanClass().equals(handlerClass)) { mappings.add(restfulMapping); } } return mappings; }
public boolean isMapped(RestfulMapping mapping) { boolean mapped = false; for (RestfulMapping cachedMapping : this.cache.values()) { mapped = CollectionUtils.containsAny(cachedMapping.getUrls(), mapping.getUrls()) && CollectionUtils.containsAny( cachedMapping.getHttpMethods(), mapping.getHttpMethods()); if (mapped) { break; } } return mapped; }
public void add(String id, RestfulMapping mapping) { this.cache.put(id, mapping); this.mappedHandlers.add(mapping.getBeanClass()); }