44import java .util .List ;
55import java .util .Map ;
66import java .util .Set ;
7+ import java .util .function .Function ;
78
89/**
910 * Interface for dealing with configured properties
@@ -174,7 +175,7 @@ public interface Configurator {
174175 long findLongEntry (String param , long dflt );
175176
176177 /**
177- * Find config entry as an double
178+ * Find config entry as a double
178179 *
179180 * @param param name of config entry
180181 * @param dflt default value when none found
@@ -183,7 +184,7 @@ public interface Configurator {
183184 double findDoubleEntry (String param , double dflt );
184185
185186 /**
186- * Find config entry as an boolean
187+ * Find config entry as a boolean
187188 *
188189 * @param param name of config entry
189190 * @param dflt default value when none found
@@ -193,14 +194,25 @@ public interface Configurator {
193194
194195
195196 /**
196- * Find config entry as an boolean
197+ * Find config entry as a boolean
197198 *
198199 * @param param name of config entry
199200 * @param dflt default value when none found
200201 * @return boolean value or dflt when none found or not a boolean
201202 */
202203 boolean findBooleanEntry (String param , String dflt );
203204
205+ /**
206+ * Find config entry as a generic Object
207+ *
208+ * @param param name of config entry
209+ * @param parser method to turn entry from String into the correct type
210+ * @param dflt default value when none found
211+ * @return object value or dflt when none found or not the right type
212+ * @param <T> the type of the return object
213+ */
214+ <T > T findObjectEntry (String param , Function <String , T > parser , T dflt );
215+
204216 /**
205217 * Get the names of all entries for this config. This set is not backed by the configuration and any changes to it are
206218 * not relflected in the configuration.
0 commit comments