19441: Use Optional instead of Option in http core javadsl

This commit is contained in:
Endre Sándor Varga 2016-01-15 13:03:27 +01:00
parent 7a39063f2e
commit 57c1dfde8a
54 changed files with 302 additions and 248 deletions

View file

@ -10,10 +10,11 @@ import akka.http.javadsl.model.MediaTypes;
import akka.http.javadsl.server.RequestVal;
import akka.http.javadsl.testkit.JUnitRouteTest;
import akka.http.javadsl.testkit.TestRoute;
import akka.japi.Option;
import akka.japi.Pair;
import org.junit.Test;
import java.util.Optional;
public class FormFieldsTest extends JUnitRouteTest {
static FormField<String> stringParam = FormFields.stringValue("stringParam");
static FormField<Byte> byteParam = FormFields.byteValue("byteParam");
@ -29,7 +30,7 @@ public class FormFieldsTest extends JUnitRouteTest {
static FormField<Long> hexLongParam = FormFields.hexLongValue("hexLongParam");
static RequestVal<String> nameWithDefault = FormFields.stringValue("nameWithDefault").withDefault("John Doe");
static RequestVal<Option<Integer>> optionalIntParam = FormFields.intValue("optionalIntParam").optional();
static RequestVal<Optional<Integer>> optionalIntParam = FormFields.intValue("optionalIntParam").optional();
private Pair<String, String> param(String name, String value) {
return Pair.create(name, value);

View file

@ -11,7 +11,6 @@ import akka.http.javadsl.server.RequestVal;
import akka.http.javadsl.server.RouteResult;
import akka.http.javadsl.testkit.JUnitRouteTest;
import akka.http.javadsl.testkit.TestRoute;
import akka.japi.Option;
import org.junit.Test;
import java.util.*;
@ -31,7 +30,7 @@ public class ParametersTest extends JUnitRouteTest {
static Parameter<Long> hexLongParam = Parameters.hexLongValue("hexLongParam");
static RequestVal<String> nameWithDefault = Parameters.stringValue("nameWithDefault").withDefault("John Doe");
static RequestVal<Option<Integer>> optionalIntParam = Parameters.intValue("optionalIntParam").optional();
static RequestVal<Optional<Integer>> optionalIntParam = Parameters.intValue("optionalIntParam").optional();
static RequestVal<Map<String, String>> paramMap = Parameters.asMap();
static RequestVal<Map<String, Collection<String>>> paramMultiMap = Parameters.asMultiMap();