@Test public void testWalkN() { JsonElement pop = JsonFunctions.walkN("europe", "france", "population").apply( europeMap() ); Assert.assertEquals( (int)JsonFunctions.cast(Integer.class).apply(pop), 80*1000*1000 ); }
public static Function<JsonElement, JsonElement> walkN(@Nullable String elements) { return walkN( Splitter.on('.').split(elements) ); }
JsonFunctions { public static Function<JsonElement, JsonElement> walkN(@Nullable String elements) { return walkN( Splitter.on('.').split(elements) ); } }
JsonFunctions { public static Function<JsonElement, JsonElement> walkN(@Nullable String elements) { return walkN( Splitter.on('.').split(elements) ); } private  JsonFunctions(); }
JsonFunctions { public static Function<JsonElement, JsonElement> walkN(@Nullable String elements) { return walkN( Splitter.on('.').split(elements) ); } private  JsonFunctions(); static Function<String, JsonElement> asJson(); static Function<JsonElement, List<T>> forEach(final Function<JsonElement, T> func); static Function<JsonElement, JsonElement> walk(String elementOrDotSeparatedElements); static Function<JsonElement, JsonElement> walk(final String... elements); static Function<JsonElement, JsonElement> walk(final Iterable<String> elements); static Function<JsonElement, JsonElement> walkN(@Nullable String elements); static Function<JsonElement, JsonElement> walkN(final String... elements); static Function<JsonElement, JsonElement> walkN(final Iterable<String> elements); static Function<Maybe<JsonElement>, Maybe<JsonElement>> walkM(@Nullable String elements); static Function<Maybe<JsonElement>, Maybe<JsonElement>> walkM(final String... elements); static Function<Maybe<JsonElement>, Maybe<JsonElement>> walkM(final Iterable<String> elements); static Function<JsonElement,T> getPath(final String path); static Function<JsonElement, T> cast(final Class<T> expected); static Function<Maybe<JsonElement>, T> castM(final Class<T> expected); static Function<Maybe<JsonElement>, T> castM(final Class<T> expected, final T defaultValue); }
JsonFunctions { public static Function<JsonElement, JsonElement> walkN(@Nullable String elements) { return walkN( Splitter.on('.').split(elements) ); } private  JsonFunctions(); static Function<String, JsonElement> asJson(); static Function<JsonElement, List<T>> forEach(final Function<JsonElement, T> func); static Function<JsonElement, JsonElement> walk(String elementOrDotSeparatedElements); static Function<JsonElement, JsonElement> walk(final String... elements); static Function<JsonElement, JsonElement> walk(final Iterable<String> elements); static Function<JsonElement, JsonElement> walkN(@Nullable String elements); static Function<JsonElement, JsonElement> walkN(final String... elements); static Function<JsonElement, JsonElement> walkN(final Iterable<String> elements); static Function<Maybe<JsonElement>, Maybe<JsonElement>> walkM(@Nullable String elements); static Function<Maybe<JsonElement>, Maybe<JsonElement>> walkM(final String... elements); static Function<Maybe<JsonElement>, Maybe<JsonElement>> walkM(final Iterable<String> elements); static Function<JsonElement,T> getPath(final String path); static Function<JsonElement, T> cast(final Class<T> expected); static Function<Maybe<JsonElement>, T> castM(final Class<T> expected); static Function<Maybe<JsonElement>, T> castM(final Class<T> expected, final T defaultValue);  }