/** * Get the entity type for a name. * @param name The type name. * @return The entity type with name `name`. */ @Nonnull @JsonCreator public static EntityType forName(String name) { String normedName = name.toLowerCase(Locale.ROOT); EntityType type = new EntityType(normedName); EntityType canonical = TYPE_CACHE.putIfAbsent(normedName, type); return canonical == null ? type : canonical; } }
/** * Get the entity type for a name. * @param name The type name. * @return The entity type with name `name`. */ @Nonnull @JsonCreator public static EntityType forName(String name) { String normedName = name.toLowerCase(Locale.ROOT); EntityType type = new EntityType(normedName); EntityType canonical = TYPE_CACHE.putIfAbsent(normedName, type); return canonical == null ? type : canonical; } }