/** * Returns a model for the given {@code descriptor}. * @param descriptor the descriptor * @return the model */ protected Map<String, Object> createModelForDescriptor(LinkDescriptor descriptor) { Map<String, Object> model = new HashMap<>(); model.put("rel", descriptor.getRel()); model.put("description", descriptor.getDescription()); model.put("optional", descriptor.isOptional()); model.putAll(descriptor.getAttributes()); return model; }
for (Entry<String, LinkDescriptor> relAndDescriptor : this.descriptorsByRel .entrySet()) { if (!relAndDescriptor.getValue().isOptional()) { requiredRels.add(relAndDescriptor.getKey());
private LinkDescriptor createDescriptor(String description, LinkDescriptor source) { LinkDescriptor newDescriptor = new LinkDescriptor(source.getRel()) .description(description); if (source.isOptional()) { newDescriptor.optional(); } if (source.isIgnored()) { newDescriptor.ignored(); } return newDescriptor; }