package com.metamx.common.parsers;


import com.google.common.base.Function;

import java.io.IOException;
import java.util.Map;

public class Parsers
{
  public static <K, V> Function<String, Map<K, V>> toFunction(final Parser p) {
    return new Function<String, Map<K, V>>() {
      @Override
      public Map<K, V> apply(String input) {
        try {
          return p.parse(input);
        }
        catch(IOException e) {
          return null;
        }
      }
    };
  }
}

@@ -224,16 +224,160 @@
 ser p) %7B
+%0A%0A    /**%0A     * Creates a Function object wrapping the given parser.%0A     * Parser inputs that throw an IOException are mapped to null.%0A     */
 %0A    ret

add javadoc