*/
public static HystrixCollapserProperties getCollapserProperties(HystrixCollapserKey key, HystrixCollapserProperties.Setter builder) {
HystrixPropertiesStrategy hystrixPropertiesStrategy = HystrixPlugins.getInstance().getPropertiesStrategy();
String cacheKey = hystrixPropertiesStrategy.getCollapserPropertiesCacheKey(key, builder);
if (cacheKey != null) {
HystrixCollapserProperties properties = collapserProperties.get(cacheKey);
if (properties != null) {
return properties;
} else {
if (builder == null) {
builder = HystrixCollapserProperties.Setter();
}
// create new instance
properties = hystrixPropertiesStrategy.getCollapserProperties(key, builder);
// cache and return
HystrixCollapserProperties existing = collapserProperties.putIfAbsent(cacheKey, properties);
if (existing == null) {
return properties;
} else {
return existing;
}