net.morimekta.config.util.ValueConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of config-util Show documentation
Show all versions of config-util Show documentation
Configuration Utilities.
NOTE: This module is deprecated and will be removed at the end of the
v2.x versions of the utilities. Preferred config system after that is
either to use true type-safe config with `net.morimekta.providence:providence-config`
or to use a simple JSON or YAML library or java properties files. The
semi-typesafe layered config did not really solve the problems I had
hoped it would, and in essence this was just a helper for merging maps
and getting pre-cast values out of it.
package net.morimekta.config.util;
/**
* Simple interface for functions that converts config values.
*/
@FunctionalInterface
public interface ValueConverter {
/**
* Convert value to a given type.
*
* @param o Object to convert.
* @return The converted instance.
*/
T convert(Object o);
}