@ SafeVarargs public static Map < String , Object > payloadFactory ( Map . Entry < String , Object > ... entries ) { Map < String , Object > map = new HashMap <> ( ) ; for ( Map . Entry < String , Object > entry : entries ) map . put ( entry . getKey ( ) , entry . getValue ( ) ) ; return Collections . unmodifiableMap ( map ) ; }
This method was created to simplify the construction of request payloads . However the use of this method shouldn t be compulsory and you can also use plain old Maps .