/** * An internal constructor. */ BindableDescriptor(Class<?> bindableType, BindableMetadata metadata, Map<Field, BindableDescriptor> bindableDescriptors, Map<String, AttributeDescriptor> attributeDescriptors, GroupingMethod groupBy) { this.type = bindableType; this.prefix = BindableUtils.getPrefix(bindableType); this.metadata = metadata; this.bindableDescriptorsInternal = bindableDescriptors; this.attributeDescriptorsInternal = attributeDescriptors; this.groupedBy = groupBy; final LinkedHashMap<String, AttributeDescriptor> newAttributeDescriptors = Maps .newLinkedHashMap(); final LinkedHashMap<Object, Map<String, AttributeDescriptor>> newAttributeGroups = Maps .newLinkedHashMap(); buildAttributeGroups(newAttributeDescriptors, newAttributeGroups, this, groupedBy); this.attributeDescriptors = Collections.unmodifiableMap(newAttributeDescriptors); this.attributeGroups = Collections.unmodifiableMap(newAttributeGroups); }