@Test public void returnsMapperFromStringToPossibleLong() { assertThat(fromStringToPossibleLong().map("1234"), is(option(1234L))); }
public static Mapper<String, Option<Long>> fromStringToPossibleLong() { return new Mapper<String, Option<Long>>() { @Override public Option<Long> map(String input) { try { return option(Long.valueOf(input)); } catch(NumberFormatException e) { return none(); } catch(NullPointerException e) { return none(); } } }; }
Longs { public static Mapper<String, Option<Long>> fromStringToPossibleLong() { return new Mapper<String, Option<Long>>() { @Override public Option<Long> map(String input) { try { return option(Long.valueOf(input)); } catch(NumberFormatException e) { return none(); } catch(NullPointerException e) { return none(); } } }; } }
Longs { public static Mapper<String, Option<Long>> fromStringToPossibleLong() { return new Mapper<String, Option<Long>>() { @Override public Option<Long> map(String input) { try { return option(Long.valueOf(input)); } catch(NumberFormatException e) { return none(); } catch(NullPointerException e) { return none(); } } }; } private  Longs(); }
Longs { public static Mapper<String, Option<Long>> fromStringToPossibleLong() { return new Mapper<String, Option<Long>>() { @Override public Option<Long> map(String input) { try { return option(Long.valueOf(input)); } catch(NumberFormatException e) { return none(); } catch(NullPointerException e) { return none(); } } }; } private  Longs(); static Mapper<String, Long> fromStringToLong(); static Mapper<Integer, Long> fromIntegerToLong(); static Mapper<BigInteger, Long> fromBigIntegerToLong(); static Mapper<Float, Long> fromFloatToLong(); static Mapper<Double, Long> fromDoubleToLong(); static Mapper<BigDecimal, Long> fromBigDecimalToLong(); static Long toLongOrNull(String value); static Long toLongOrNull(Integer value); static Long toLongOrNull(BigInteger value); static Long toLongOrNull(Float value); static Long toLongOrNull(Double value); static Long toLongOrNull(BigDecimal value); static Mapper<String, Option<Long>> fromStringToPossibleLong(); }
Longs { public static Mapper<String, Option<Long>> fromStringToPossibleLong() { return new Mapper<String, Option<Long>>() { @Override public Option<Long> map(String input) { try { return option(Long.valueOf(input)); } catch(NumberFormatException e) { return none(); } catch(NullPointerException e) { return none(); } } }; } private  Longs(); static Mapper<String, Long> fromStringToLong(); static Mapper<Integer, Long> fromIntegerToLong(); static Mapper<BigInteger, Long> fromBigIntegerToLong(); static Mapper<Float, Long> fromFloatToLong(); static Mapper<Double, Long> fromDoubleToLong(); static Mapper<BigDecimal, Long> fromBigDecimalToLong(); static Long toLongOrNull(String value); static Long toLongOrNull(Integer value); static Long toLongOrNull(BigInteger value); static Long toLongOrNull(Float value); static Long toLongOrNull(Double value); static Long toLongOrNull(BigDecimal value); static Mapper<String, Option<Long>> fromStringToPossibleLong();  }