title: Apache Avro: map uses CharSequence as key
body: <p>I am using <a href="http://avro.apache.org/docs/1.7.5/gettingstartedjava.html" rel="noreferrer">Apache Avro</a>.</p>
  
  <p>My schema has map type:</p>
  
  <pre><code>{"name": "MyData", 
    "type" :  {"type": "map", 
                "values":{
                     "type": "record",
                     "name": "Person",
                     "fields":[
                        {"name": "name", "type": "string"},
                        {"name": "age", "type": "int"},
  
                  ]
                  }
                 }
  }
  </code></pre>
  
  <p>After compile the schema, the genated Java class use <code>CharSequence</code> as the <strong>key</strong>  for the <code>Map</code>  <code>MyData</code>. </p>
  
  <p>It is very inconvenient to use <code>CharSequence</code> in <code>Map</code> as key, is there a way to generate <code>String</code> type key for <code>Map</code> in <a href="http://avro.apache.org/docs/1.7.5/gettingstartedjava.html" rel="noreferrer">Apache Avro</a>?</p>
  
  <p><strong>P.S.</strong></p>
  
  <p>Problem is that, for example <code>dataMap.containsKey("SOME_KEY")</code> will returns <code>false</code> even though there is such key there, just because it is <code>CharSequence</code>. Besides, put an map entry with a existing key doesn't relpace the old one. That's why I say it is inconvenient to use <code>CharSequence</code> as key.</p>