org.zodiac.actuate.health.AppCompositeHealthContributorReactiveAdapter Maven / Gradle / Ivy
package org.zodiac.actuate.health;
import java.util.Iterator;
import org.springframework.util.Assert;
class AppCompositeHealthContributorReactiveAdapter implements AppCompositeReactiveHealthContributor {
private final AppCompositeHealthContributor delegate;
AppCompositeHealthContributorReactiveAdapter(AppCompositeHealthContributor delegate) {
Assert.notNull(delegate, "Delegate must not be null");
this.delegate = delegate;
}
@Override
public Iterator> iterator() {
Iterator> iterator = this.delegate.iterator();
return new Iterator>() {
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public AppNamedContributor next() {
AppNamedContributor namedContributor = iterator.next();
return AppNamedContributor.of(namedContributor.getName(),
AppReactiveHealthContributor.adapt(namedContributor.getContributor()));
}
};
}
@Override
public AppReactiveHealthContributor getContributor(String name) {
AppHealthContributor contributor = this.delegate.getContributor(name);
return (contributor != null) ? AppReactiveHealthContributor.adapt(contributor) : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy