Malleswar_Arun study
-
- @Rest Controller (#Rest Controller)
-
- @Request Mapping (#Request-Mapping)
https://www.programmersought.com/article/683793165/
- @Apilgnore: Use this annotation to indicate that Swagger2 ignores this API
- @ApiOperation : A method describing the class, or an interface
-
@configuration
Spring @Configuration annotation helps in Spring annotation based configuration. @Configuration annotation indicates that a class declares one or more @Bean methods and may be processed by the Spring container to generate bean definitions and service requests for those beans at runtime.
-
@EnableConfigurationProperties
Spring EnableConfigurationProperties annotation is strictly connected to @ConfiguratonProperties. It enables support for @ConfigurationProperties annotated classes in our application. However, it's worth to point out that the Spring Boot documentation says, every project automatically includes @EnableConfigurationProperties
-
Spring Framework - @Async and @EnableAsync Examples
@ConfigurationProperties
In Spring Boot, the @ConfigurationProperties annotation allows us to map the resource files such as properties or YAML files to Java Bean object.
This annotation is applied to a class or a @Bean method in a @Configuration class to map or validate the external properties or YAML files.
application.properties
myapp.mail.to=sunil@example.com
myapp.mail.host=mail.example.com
myapp.mail.port=250
Example code
@ConfigurationProperties(prefix="myapp.mail")
public class MailProperties {
private String to;
private String host;
private int port;
//Setter and getter methods
}
https://www.boraji.com/spring-boot-configurationproperties-example
@controlleradvice
Create Rest api we can use
- spring Mvc
- @Rest controller
- @ExceptionHandler annotation is used for handling exceptions in specific handler classes and/or handler methods.reference
-
@Data is a convenient shortcut annotation that bundles the features of @ToString , @EqualsAndHashCode , @Getter / @Setter and @RequiredArgsConstructor together: In other words, @Data generates all the boilerplate that is normally associated with simple POJOs (Plain Old Java Objects) and beans: getters for all fields
-
@ToString annotation enables you to avoid having to manually write a toString() method while inspecting fields for your objects.