Code example for ImmutableMap

Methods: get

     * @param field field name as specified in the {@link GetFieldMappingsRequest} 
     * @return FieldMappingMetaData for the requested field or null if not found. 
    public FieldMappingMetaData fieldMappings(String index, String type, String field) {
        ImmutableMap<String, ImmutableMap<String, FieldMappingMetaData>> indexMapping = mappings.get(index);
        if (indexMapping == null) {
            return null; 
        ImmutableMap<String, FieldMappingMetaData> typeMapping = indexMapping.get(type);
        if (typeMapping == null) {
            return null; 
        return typeMapping.get(field);
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        for (Map.Entry<String, ImmutableMap<String, ImmutableMap<String, FieldMappingMetaData>>> indexEntry : mappings.entrySet()) {
            builder.startObject(indexEntry.getKey(), XContentBuilder.FieldCaseConversion.NONE);