Java Utililty Methods Map Join

List of utility methods to do Map Join

Description

The list of methods to do Map Join are organized into topic(s).

Method

StringjoinMap(Map map)
join Map
if (map.isEmpty()) {
    return "";
StringBuilder stringBuilder = new StringBuilder();
boolean notFirst = false;
for (Map.Entry<?, ?> entry : map.entrySet()) {
    if (notFirst) {
        stringBuilder.append(',');
...
StringjoinMapToString(Map map, String sSeparator, String sMidSeparator)
join Map To String
StringBuilder sb = new StringBuilder();
Iterator it = map.entrySet().iterator();
boolean First = true;
while (it.hasNext()) {
    Map.Entry tmpEntry = (Map.Entry) it.next();
    if (First) {
        First = false;
    } else {
...
MapjoinMapUnmodifiable(Map first, Map second)
Join the two given maps to one by checking if one of the two maps already fulfills everything.
if (first == null || first.isEmpty()) {
    if (second == null || second.isEmpty()) {
        return Collections.emptyMap();
    } else {
        return Collections.unmodifiableMap(second);
} else if (second == null || second.isEmpty()) {
    return Collections.unmodifiableMap(first);
...
StringjoinMapValue(Map map, char connector)
join Map Value
StringBuffer b = new StringBuffer();
for (Map.Entry<String, String> entry : map.entrySet()) {
    b.append(entry.getKey());
    b.append('=');
    if (entry.getValue() != null) {
        b.append(entry.getValue());
    b.append(connector);
...
StringjoinOnDelimiter(Map toJoin, char delimiter)
Convert properties to a string representation, based on the specified delimiter.
StringBuffer buf = new StringBuffer();
for (Iterator it = toJoin.entrySet().iterator(); it.hasNext();) {
    Map.Entry e = (Map.Entry) it.next();
    String key = (String) e.getKey();
    String value = (String) e.getValue();
    buf.append(key);
    buf.append("=");
    buf.append(value);
...
StringjoinOnSemicolon(Map toJoin)
Convert properties to a string representation.
return joinOnDelimiter(toJoin, SEMICOLON);
StringjoinParameters(Map params)
join Parameters
StringBuilder bob = new StringBuilder();
for (Entry<String, String> e : params.entrySet()) {
    bob.append("&");
    bob.append(e.getKey());
    bob.append("=");
    bob.append(e.getValue());
return bob.substring(1);
...