Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/monosoul/spring-orderconfig
A library that provides a convenient way of configuring decorators order in Spring
https://github.com/monosoul/spring-orderconfig
Last synced: about 2 months ago
JSON representation
A library that provides a convenient way of configuring decorators order in Spring
- Host: GitHub
- URL: https://github.com/monosoul/spring-orderconfig
- Owner: monosoul
- License: apache-2.0
- Created: 2019-04-29T06:26:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-16T17:24:16.000Z (over 5 years ago)
- Last Synced: 2023-08-02T22:07:54.196Z (over 1 year ago)
- Language: Groovy
- Homepage:
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spring Orderconfig
A library that provides a convenient way of configuring decorators order in Spring.[![Build Status](https://travis-ci.com/monosoul/spring-orderconfig.svg?branch=master)](https://travis-ci.com/monosoul/spring-orderconfig)
[![codecov](https://codecov.io/gh/monosoul/spring-orderconfig/branch/master/graph/badge.svg)](https://codecov.io/gh/monosoul/spring-orderconfig)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.monosoul/spring-orderconfig/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.monosoul/spring-orderconfig)
![license](https://img.shields.io/github/license/monosoul/spring-orderconfig.svg)## Getting Started
To add the dependency to you maven build, simply add this to your `pom.xml`:
```xmlcom.github.monosoul
spring-orderconfig
0.0.2```
Or with gradle, using Kotlin DSL:
```kotlin
dependencies {
implementation("com.github.monosoul:spring-orderconfig:0.0.2")
}
```**Please, be advised that this library doesn't have any transitive dependencies on Spring Framework or Spring Boot,
so you have to add the necessary Spring dependencies on your own.**This is done to avoid classpath pollution with multiple versions of spring.
### Prerequisites
This library has been tested with Spring Boot version `2.1.4`. Should also work fine with Spring Framework versions
`>=4.1.x`.The library is compiled with Java 8 as target, so you'd also need at least Java 8 to use it.
### Usage example
An example of 2 implementations of the same interface:
```java
public interface SomeInterface {}@Component
public class SomeClass implements SomeInterface {
private final SomeInterface dependency;@Autowired
public SomeClass(final SomeInterface dependency) {
this.dependency = dependency;
}
}@Component
public class AnotherClass implements SomeInterface {
//some logic here
}@Configuration
public class JavaConfig {@Bean
public OrderConfig someInterfaceOrderConfig() {
return new OrderConfigImpl<>(Arrays.asList(
OrderConfigItemImpl.of(SomeClass.class),
OrderConfigItemImpl.of(AnotherClass.class)
));
}
}
```is equal to:
```java
public interface SomeInterface {}@Component
public class SomeClass implements SomeInterface {
private final SomeInterface dependency;@Autowired
public SomeClass(@Qualifier("someClass") final SomeInterface dependency) {
this.dependency = dependency;
}
}@Component
public class AnotherClass implements SomeInterface {
//some logic here
}
```## Release History
* 0.0.2
* Use delomboked sources for sources.jar and javadoc.jar generation
* 0.0.1
* Initial release
## License
The software is licensed under the [Apache-2.0 License](LICENSE).