private static <T extends Enum<T>> T tryValueOf(final Class<T> clazz, final String value) {
    if (clazz == null || value == null) {
      return null;
    }
    try {
      return Enum.valueOf(clazz, value);
    } catch (IllegalArgumentException e) {
      return null;
    }
  }
Adds {@code value} to {@code encoder} under {@code paramName} when {@code value} is non-null.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/MetaBrowser.java