+doc add more detailed PathDirectives documentation
This commit is contained in:
parent
7291d0ccab
commit
ed76b14447
9 changed files with 284 additions and 20 deletions
|
|
@ -17,7 +17,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import static akka.http.javadsl.server.Directives.*;
|
||||
|
||||
public class PetStoreExample {
|
||||
static PathMatcher<Integer> petId = PathMatchers.integerNumber();
|
||||
static PathMatcher<Integer> petId = PathMatchers.intValue();
|
||||
static RequestVal<Pet> petEntity = RequestVals.entityAs(Jackson.jsonAs(Pet.class));
|
||||
|
||||
public static Route appRoute(final Map<Integer, Pet> pets) {
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ public class SimpleServerApp extends HttpApp {
|
|||
static Parameter<Integer> x = Parameters.intValue("x");
|
||||
static Parameter<Integer> y = Parameters.intValue("y");
|
||||
|
||||
static PathMatcher<Integer> xSegment = PathMatchers.integerNumber();
|
||||
static PathMatcher<Integer> ySegment = PathMatchers.integerNumber();
|
||||
static PathMatcher<Integer> xSegment = PathMatchers.intValue();
|
||||
static PathMatcher<Integer> ySegment = PathMatchers.intValue();
|
||||
|
||||
static RequestVal<String> bodyAsName = RequestVals.entityAs(Unmarshallers.String());
|
||||
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ public class PathDirectivesTest extends JUnitRouteTest {
|
|||
|
||||
@Test
|
||||
public void testIntegerMatcher() {
|
||||
PathMatcher<Integer> age = PathMatchers.integerNumber();
|
||||
PathMatcher<Integer> age = PathMatchers.intValue();
|
||||
|
||||
TestRoute route =
|
||||
testRoute(
|
||||
|
|
@ -233,8 +233,8 @@ public class PathDirectivesTest extends JUnitRouteTest {
|
|||
public void testTwoVals() {
|
||||
// tests that `x` and `y` have different identities which is important for
|
||||
// retrieving the values
|
||||
PathMatcher<Integer> x = PathMatchers.integerNumber();
|
||||
PathMatcher<Integer> y = PathMatchers.integerNumber();
|
||||
PathMatcher<Integer> x = PathMatchers.intValue();
|
||||
PathMatcher<Integer> y = PathMatchers.intValue();
|
||||
|
||||
TestRoute route =
|
||||
testRoute(
|
||||
|
|
@ -254,7 +254,7 @@ public class PathDirectivesTest extends JUnitRouteTest {
|
|||
|
||||
@Test
|
||||
public void testHexIntegerMatcher() {
|
||||
PathMatcher<Integer> color = PathMatchers.hexIntegerNumber();
|
||||
PathMatcher<Integer> color = PathMatchers.hexIntValue();
|
||||
|
||||
TestRoute route =
|
||||
testRoute(
|
||||
|
|
@ -267,7 +267,7 @@ public class PathDirectivesTest extends JUnitRouteTest {
|
|||
|
||||
@Test
|
||||
public void testLongMatcher() {
|
||||
PathMatcher<Long> bigAge = PathMatchers.longNumber();
|
||||
PathMatcher<Long> bigAge = PathMatchers.longValue();
|
||||
|
||||
TestRoute route =
|
||||
testRoute(
|
||||
|
|
@ -280,7 +280,7 @@ public class PathDirectivesTest extends JUnitRouteTest {
|
|||
|
||||
@Test
|
||||
public void testHexLongMatcher() {
|
||||
PathMatcher<Long> code = PathMatchers.hexLongNumber();
|
||||
PathMatcher<Long> code = PathMatchers.hexLongValue();
|
||||
|
||||
TestRoute route =
|
||||
testRoute(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue