From b36238a2ff4d86510bfbba442c43631a441076b7 Mon Sep 17 00:00:00 2001 From: Roberto Cortez Date: Wed, 10 Jan 2024 16:59:48 +0000 Subject: [PATCH] Remove unneeded class --- .../SmallRyeConfigSourceInterceptors.java | 92 ------------------- 1 file changed, 92 deletions(-) delete mode 100644 implementation/src/main/java/io/smallrye/config/SmallRyeConfigSourceInterceptors.java diff --git a/implementation/src/main/java/io/smallrye/config/SmallRyeConfigSourceInterceptors.java b/implementation/src/main/java/io/smallrye/config/SmallRyeConfigSourceInterceptors.java deleted file mode 100644 index db8b0c397..000000000 --- a/implementation/src/main/java/io/smallrye/config/SmallRyeConfigSourceInterceptors.java +++ /dev/null @@ -1,92 +0,0 @@ -package io.smallrye.config; - -import java.util.Iterator; -import java.util.List; - -public class SmallRyeConfigSourceInterceptors implements ConfigSourceInterceptorContext { - private final List interceptors; - - private int current = 0; - - public SmallRyeConfigSourceInterceptors(final List interceptors) { - this.interceptors = interceptors; - } - - ConfigValue getValue(final String name) { - ConfigValue configValue = null; - for (int i = 0; i < interceptors.size(); i++) { - ConfigSourceInterceptor interceptor = interceptors.get(i); - configValue = interceptor.getValue(this, name); - } - return configValue; - } - - @Override - public ConfigValue proceed(final String name) { - ConfigSourceInterceptorContext context = new ConfigSourceInterceptorContext() { - int position = 0; - - @Override - public ConfigValue proceed(final String name) { - return interceptors.get(position++).getValue(this, name); - } - - public ConfigValue restart(final String name) { - int old = position; - position = 0; - try { - return proceed(name); - } finally { - position = old; - } - } - - @Override - public Iterator iterateNames() { - return null; - } - - @Override - public Iterator iterateValues() { - return null; - } - }; - return context.proceed(name); - } - - public ConfigValue restart(final String name) { - throw new UnsupportedOperationException(); - } - - @Override - public Iterator iterateNames() { - return null; - } - - @Override - public Iterator iterateValues() { - return null; - } - - public static void main(String[] args) { - SmallRyeConfigSourceInterceptors interceptors = new SmallRyeConfigSourceInterceptors( - List.of(new ConfigSourceInterceptor() { - @Override - public ConfigValue getValue(final ConfigSourceInterceptorContext context, final String name) { - return context.proceed(name); - } - }, new ConfigSourceInterceptor() { - @Override - public ConfigValue getValue(final ConfigSourceInterceptorContext context, final String name) { - return context.proceed(name); - } - }, new ConfigSourceInterceptor() { - @Override - public ConfigValue getValue(final ConfigSourceInterceptorContext context, final String name) { - throw new RuntimeException(); - } - })); - - interceptors.getValue("foo.bar"); - } -}