List of usage examples for org.apache.commons.collections4.map CaseInsensitiveMap CaseInsensitiveMap
public CaseInsensitiveMap(final Map<? extends K, ? extends V> map)
From source file:com.dangdang.ddframe.rdb.sharding.merger.component.other.WrapperResultSet.java
/** * ?.//from ww w .j a va 2s . co m * * @return * @throws SQLException ?? */ public Map<String, Integer> getColumnLabelIndexMap() throws SQLException { ResultSetMetaData resultSetMetaData = getDelegate().getMetaData(); Map<String, Integer> result = new CaseInsensitiveMap<>(resultSetMetaData.getColumnCount()); for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) { result.put(resultSetMetaData.getColumnLabel(i), i); } return result; }
From source file:com.joyent.manta.util.LookupMap.java
/** * Creates a new instance of a lookup map backed by the specified map. * * @param backingMap map to back lookup map *//* w ww .jav a2 s . c o m*/ public LookupMap(final Map<String, V> backingMap) { if (isUnmodifiable(backingMap)) { this.wrapped = backingMap; } else { this.wrapped = Collections.unmodifiableMap(backingMap); } this.lowercaseWrapped = new CaseInsensitiveMap<>(this.wrapped); }
From source file:com.dangdang.ddframe.rdb.sharding.jdbc.adapter.AbstractResultSetAdapter.java
private Map<String, Integer> generateColumnLabelIndexMap() throws SQLException { ResultSetMetaData resultSetMetaData = resultSets.get(0).getMetaData(); Map<String, Integer> result = new CaseInsensitiveMap<>(resultSetMetaData.getColumnCount()); for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) { result.put(resultSetMetaData.getColumnLabel(i), i); }/* ww w.j a v a2s . c om*/ return result; }
From source file:com.mirth.connect.plugins.httpauth.RequestInfo.java
private void setHeaders(Map<String, List<String>> headers) { if (headers == null) { headers = new HashMap<String, List<String>>(); }//from w w w . j a va 2 s. c om this.headers = new CaseInsensitiveMap<String, List<String>>(headers); }
From source file:com.mirth.connect.plugins.httpauth.RequestInfo.java
private void setQueryParameters(Map<String, List<String>> queryParameters) { if (queryParameters == null) { queryParameters = new HashMap<String, List<String>>(); }/*from w w w. j a v a 2s. c o m*/ this.queryParameters = new CaseInsensitiveMap<String, List<String>>(queryParameters); }
From source file:net.dv8tion.jda.core.entities.EntityBuilder.java
public AuditLogEntry createAuditLogEntry(GuildImpl guild, JSONObject entryJson, JSONObject userJson) { final long targetId = entryJson.isNull("target_id") ? 0 : entryJson.getLong("target_id"); final long id = entryJson.getLong("id"); final int typeKey = entryJson.getInt("action_type"); final JSONArray changes = entryJson.isNull("changes") ? null : entryJson.getJSONArray("changes"); final JSONObject options = entryJson.isNull("options") ? null : entryJson.getJSONObject("options"); final String reason = entryJson.isNull("reason") ? null : entryJson.getString("reason"); final UserImpl user = (UserImpl) createFakeUser(userJson, false); final Set<AuditLogChange> changesList; final ActionType type = ActionType.from(typeKey); if (changes != null) { changesList = new HashSet<>(changes.length()); for (int i = 0; i < changes.length(); i++) { final JSONObject object = changes.getJSONObject(i); AuditLogChange change = createAuditLogChange(object); changesList.add(change);// w w w. j a v a 2 s.c o m } } else { changesList = Collections.emptySet(); } CaseInsensitiveMap<String, AuditLogChange> changeMap = new CaseInsensitiveMap<>(changeToMap(changesList)); CaseInsensitiveMap<String, Object> optionMap = options != null ? new CaseInsensitiveMap<>(options.toMap()) : null; return new AuditLogEntry(type, id, targetId, guild, user, reason, changeMap, optionMap); }