@Test public void setClassToIdMap() { Map<Class<?>, String> map = new HashMap<Class<?>, String>(); map.put(ClassAliasIdResolverTest.class, "cairt"); builder.setClassToId(map); }
public void setClassToId(final Map<Class<?>, String> classToId) { Map<String, Class<?>> reverseMap = new HashMap<String, Class<?>>(); for (Map.Entry<Class<?>, String> entry : classToId.entrySet()) { Assert.notNull(entry.getKey(), "Class cannot be null: " + entry); Assert.hasText(entry.getValue(), "Alias (id) cannot be null or contain only whitespaces" + entry); if (reverseMap.put(entry.getValue(), entry.getKey()) != null) { throw new IllegalArgumentException("Two or more classes with the same alias (id): " + entry.getValue()); } } this.classToId = classToId; this.idToClass = reverseMap; }
ClassAliasTypeResolverBuilder extends DefaultTypeResolverBuilder { public void setClassToId(final Map<Class<?>, String> classToId) { Map<String, Class<?>> reverseMap = new HashMap<String, Class<?>>(); for (Map.Entry<Class<?>, String> entry : classToId.entrySet()) { Assert.notNull(entry.getKey(), "Class cannot be null: " + entry); Assert.hasText(entry.getValue(), "Alias (id) cannot be null or contain only whitespaces" + entry); if (reverseMap.put(entry.getValue(), entry.getKey()) != null) { throw new IllegalArgumentException("Two or more classes with the same alias (id): " + entry.getValue()); } } this.classToId = classToId; this.idToClass = reverseMap; } }
ClassAliasTypeResolverBuilder extends DefaultTypeResolverBuilder { public void setClassToId(final Map<Class<?>, String> classToId) { Map<String, Class<?>> reverseMap = new HashMap<String, Class<?>>(); for (Map.Entry<Class<?>, String> entry : classToId.entrySet()) { Assert.notNull(entry.getKey(), "Class cannot be null: " + entry); Assert.hasText(entry.getValue(), "Alias (id) cannot be null or contain only whitespaces" + entry); if (reverseMap.put(entry.getValue(), entry.getKey()) != null) { throw new IllegalArgumentException("Two or more classes with the same alias (id): " + entry.getValue()); } } this.classToId = classToId; this.idToClass = reverseMap; } ClassAliasTypeResolverBuilder(final DefaultTyping typing); }
ClassAliasTypeResolverBuilder extends DefaultTypeResolverBuilder { public void setClassToId(final Map<Class<?>, String> classToId) { Map<String, Class<?>> reverseMap = new HashMap<String, Class<?>>(); for (Map.Entry<Class<?>, String> entry : classToId.entrySet()) { Assert.notNull(entry.getKey(), "Class cannot be null: " + entry); Assert.hasText(entry.getValue(), "Alias (id) cannot be null or contain only whitespaces" + entry); if (reverseMap.put(entry.getValue(), entry.getKey()) != null) { throw new IllegalArgumentException("Two or more classes with the same alias (id): " + entry.getValue()); } } this.classToId = classToId; this.idToClass = reverseMap; } ClassAliasTypeResolverBuilder(final DefaultTyping typing); void setClassToId(final Map<Class<?>, String> classToId); }
ClassAliasTypeResolverBuilder extends DefaultTypeResolverBuilder { public void setClassToId(final Map<Class<?>, String> classToId) { Map<String, Class<?>> reverseMap = new HashMap<String, Class<?>>(); for (Map.Entry<Class<?>, String> entry : classToId.entrySet()) { Assert.notNull(entry.getKey(), "Class cannot be null: " + entry); Assert.hasText(entry.getValue(), "Alias (id) cannot be null or contain only whitespaces" + entry); if (reverseMap.put(entry.getValue(), entry.getKey()) != null) { throw new IllegalArgumentException("Two or more classes with the same alias (id): " + entry.getValue()); } } this.classToId = classToId; this.idToClass = reverseMap; } ClassAliasTypeResolverBuilder(final DefaultTyping typing); void setClassToId(final Map<Class<?>, String> classToId);  }