code: @Override
      public Long indexValue(String name, Object value) {
          if (value == null) {
              return null;
          } else if (value instanceof Number) {
              return ((Number) value).longValue();
          } else if (value instanceof String) {
              String svalue = (String) value;
              try {
                  return Double.valueOf(svalue).longValue();
              } catch (NumberFormatException e) {
                  String message = String.format("Field %s requires a base 10 long, but found \"%s\"", name, svalue);
                  throw new IllegalArgumentException(message);
              }
          } else {
              String message = String.format("Field %s requires a base 10 long, but found \"%s\"", name, value);
              throw new IllegalArgumentException(message);
          }
      }
docs: {@inheritDoc}