Explorar el Código

add NameAndValue.toMap(Collection)

tags/2.0.1
Jonathan Cobb hace 4 años
padre
commit
b650f3bc50
Se han modificado 1 ficheros con 10 adiciones y 0 borrados
  1. +10
    -0
      src/main/java/org/cobbzilla/util/collection/NameAndValue.java

+ 10
- 0
src/main/java/org/cobbzilla/util/collection/NameAndValue.java Ver fichero

@@ -100,4 +100,14 @@ public class NameAndValue {
return map;
}

public static Map<String, String> toMap(Collection<NameAndValue> attrs) {
final Map<String, String> map = new HashMap<>();
if (!empty(attrs)) {
for (NameAndValue attr : attrs) {
map.put(attr.getName(), attr.value);
}
}
return map;
}

}

Cargando…
Cancelar
Guardar