
org.reactivecommons.async.starter.props.GenericAsyncPropsDomainProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of async-commons-starter Show documentation
Show all versions of async-commons-starter Show documentation
Abstract your broker with semantic async messages
package org.reactivecommons.async.starter.props;
import lombok.Getter;
import lombok.Setter;
import lombok.SneakyThrows;
import java.util.HashMap;
import java.util.Map;
@Getter
@Setter
public class GenericAsyncPropsDomainProperties, P> extends HashMap {
public GenericAsyncPropsDomainProperties(Map m) {
super(m);
}
public GenericAsyncPropsDomainProperties() {
}
public static ,
P,
X extends GenericAsyncPropsDomainProperties> AsyncPropsDomainPropertiesBuilder
builder(Class returnType) {
return new AsyncPropsDomainPropertiesBuilder<>(returnType);
}
public static class AsyncPropsDomainPropertiesBuilder, P,
X extends GenericAsyncPropsDomainProperties> {
private final Map domains = new HashMap<>();
private final Class returnType;
public AsyncPropsDomainPropertiesBuilder(Class returnType) {
this.returnType = returnType;
}
public AsyncPropsDomainPropertiesBuilder withDomain(String domain, T props) {
domains.put(domain, props);
return this;
}
@SneakyThrows
public X build() {
return returnType.getDeclaredConstructor(Map.class).newInstance(domains);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy