package org.jrivets.util;

public final class Strings {

    public static boolean isNullOrEmpty(String str) {
        return str == null || str.length() == 0 || str.trim().length() == 0;
    }
    
}

@@ -20,16 +20,120 @@
 .util;%0A%0A
+import java.util.Arrays;%0Aimport java.util.Collections;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A
 public f
@@ -291,15 +291,817 @@
 ;%0A    %7D%0A
+ %0A    public static Map%3CString, String%3E asMap(String ... strings) %7B%0A        if (strings == null %7C%7C strings.length == 0) %7B%0A            return Collections.emptyMap();%0A        %7D%0A        if ((strings.length&1) != 0) %7B%0A            throw new IllegalArgumentException(%22Number of arguments for asMap method should be even: %22 + Arrays.toString(strings));%0A        %7D%0A        HashMap%3CString, String%3E result = new HashMap%3CString, String%3E();%0A        int i = 0; %0A        while (i %3C strings.length) %7B%0A            result.put(strings%5Bi%5D, strings%5Bi+1%5D);%0A            i += 2;%0A        %7D%0A        return result;%0A    %7D%0A    %0A    public static Long asLong(String str) %7B%0A        try %7B%0A            return Long.parseLong(str);%0A        %7D catch (NumberFormatException ne) %7B%0A            // it's ok%0A        %7D%0A        return null;%0A    %7D%0A
     %0A%7D%0A

add asMap to Strings