@@ -47,41 +47,42 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
4747
4848
4949 /**
50- * Create a new LinkedCaseInsensitiveMap for the default Locale.
51- * @see java.lang.String#toLowerCase()
50+ * Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys
51+ * according to the default Locale (by default in lower case).
52+ * @see #convertKey(String)
5253 */
5354 public LinkedCaseInsensitiveMap () {
5455 this ((Locale ) null );
5556 }
5657
5758 /**
58- * Create a new LinkedCaseInsensitiveMap that stores lower- case keys
59- * according to the given Locale.
60- * @param locale the Locale to use for lower- case conversion
61- * @see java.lang.String#toLowerCase(java.util.Locale )
59+ * Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys
60+ * according to the given Locale (by default in lower case) .
61+ * @param locale the Locale to use for case-insensitive key conversion
62+ * @see #convertKey(String )
6263 */
6364 public LinkedCaseInsensitiveMap (Locale locale ) {
6465 this (16 , locale );
6566 }
6667
6768 /**
6869 * Create a new LinkedCaseInsensitiveMap that wraps a {@link LinkedHashMap}
69- * with the given initial capacity and stores lower- case keys according
70- * to the default Locale.
70+ * with the given initial capacity and stores case-insensitive keys
71+ * according to the default Locale (by default in lower case) .
7172 * @param initialCapacity the initial capacity
72- * @see java.lang.String#toLowerCase( )
73+ * @see #convertKey(String )
7374 */
7475 public LinkedCaseInsensitiveMap (int initialCapacity ) {
7576 this (initialCapacity , null );
7677 }
7778
7879 /**
7980 * Create a new LinkedCaseInsensitiveMap that wraps a {@link LinkedHashMap}
80- * with the given initial capacity and stores lower- case keys according
81- * to the given Locale.
81+ * with the given initial capacity and stores case-insensitive keys
82+ * according to the given Locale (by default in lower case) .
8283 * @param initialCapacity the initial capacity
83- * @param locale the Locale to use for lower- case conversion
84- * @see java.lang.String#toLowerCase(java.util.Locale )
84+ * @param locale the Locale to use for case-insensitive key conversion
85+ * @see #convertKey(String )
8586 */
8687 public LinkedCaseInsensitiveMap (int initialCapacity , Locale locale ) {
8788 this .targetMap = new LinkedHashMap <String , V >(initialCapacity ) {
@@ -113,6 +114,8 @@ private LinkedCaseInsensitiveMap(LinkedCaseInsensitiveMap<V> other) {
113114 }
114115
115116
117+ // Implementation of java.util.Map
118+
116119 @ Override
117120 public int size () {
118121 return this .targetMap .size ();
@@ -227,16 +230,29 @@ public String toString() {
227230 }
228231
229232
233+ // Specific to LinkedCaseInsensitiveMap
234+
235+ /**
236+ * Return the locale used by this {@code LinkedCaseInsensitiveMap}.
237+ * Used for case-insensitive key conversion.
238+ * @since 4.3.10
239+ * @see #LinkedCaseInsensitiveMap(Locale)
240+ * @see #convertKey(String)
241+ */
242+ public Locale getLocale () {
243+ return this .locale ;
244+ }
245+
230246 /**
231247 * Convert the given key to a case-insensitive key.
232248 * <p>The default implementation converts the key
233249 * to lower-case according to this Map's Locale.
234250 * @param key the user-specified key
235251 * @return the key to use for storing
236- * @see java.lang. String#toLowerCase(java.util. Locale)
252+ * @see String#toLowerCase(Locale)
237253 */
238254 protected String convertKey (String key ) {
239- return key .toLowerCase (this . locale );
255+ return key .toLowerCase (getLocale () );
240256 }
241257
242258 /**
0 commit comments