Am sorry, if am not clear : I am working on implementing Restful Services using Spring Boot. I am building a URI based on the request parameters. I am checking for the parameter values and based on that I need to build the URI using the parameter values. If it is NOT null I want to add it to the URI parameter. host/hello?abc="somevalue"
MultiValueMap<String,String> params=new LinkedMultiValueMap<String,String>();
if (null != abc) {
params.add("abc","123");
}
I am new to JDK 8 features.
1) How can I do this using JDK 8 optional features?
2) Is it possible both to throw an exception and log it using Optional?