public static HttpParameters wrap ( HttpParameters wrapped ) { // null remains null if ( wrapped == null ) return null ; // Empty are unmodifiable if ( wrapped == EmptyParameters . getInstance ( ) ) return wrapped ; // ServletRequest parameters are unmodifiable already if ( wrapped instanceof ServletRequestParameters ) return wrapped ; // Already wrapped if ( wrapped instanceof UnmodifiableHttpParameters ) return wrapped ; // Wrapping necessary return new UnmodifiableHttpParameters ( wrapped ) ; }
Wraps the given parameters to ensure they are unmodifiable .