package com.peterphi.std.guice.common.serviceprops;

import com.google.inject.Provider;
import com.peterphi.std.guice.common.serviceprops.typed.TypedConfigRef;
import org.apache.commons.configuration.Configuration;

public class ConfigRef implements Provider<String>
{
	private final Configuration configuration;
	private final String name;


	public ConfigRef(final Configuration configuration, final String name)
	{
		this.configuration = configuration;
		this.name = name;
	}


	@Override
	public String get()
	{
		return configuration.getString(name);
	}


	public <T> T get(Class<T> clazz)
	{
		return as(clazz).get();
	}


	public <T> TypedConfigRef<T> as(final Class<T> clazz)
	{
		return new TypedConfigRef<>(this, clazz);
	}
}

@@ -209,16 +209,40 @@
 ation;%0A%0A
+import java.util.List;%0A%0A
 public c
@@ -570,32 +570,273 @@
 ing(name);%0A%09%7D%0A%0A%0A
+%09public String%5B%5D getStringArray()%0A%09%7B%0A%09%09return configuration.getStringArray(name);%0A%09%7D%0A%0A%0A%09public List%3CObject%3E getList()%0A%09%7B%0A%09%09return configuration.getList(name);%0A%09%7D%0A%0A%0A%09public Object getObject()%0A%09%7B%0A%09%09return configuration.getProperty(name);%0A%09%7D%0A%0A%0A
 %09public %3CT%3E T ge

Add methods to retrieve a string[] as well as the underlying object if needed