All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.danielliu1123.httpexchange.BeanParam Maven / Gradle / Ivy

There is a newer version: 3.4.0-RC1
Show newest version
package io.github.danielliu1123.httpexchange;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Map;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Convert a Java bean to query parameters.
 *
 * 

Correct usage: *

{@code
 * @GetExchange
 * User get(@BeanParam User user);
 *
 * @GetExchange
 * User get(@RequestParam Map user);
 * }
* *

NOTE: if you consider using {@link Map} as a parameter type, you should use {@link RequestParam} instead. *

Incorrect usage: *

{@code
 * @GetExchange
 * User get(@BeanParam Map user); // use @RequestParam instead
 * }
* * @author Freeman * @since 3.1.2 */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.PARAMETER}) public @interface BeanParam {}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy