There should be a Java 8 switch, using Optional (like in the REST controllers)