Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Config {
- def from(url: String): ConfigBuilder = ???
- }
- trait ConfigBuilder {
- def overrideWith(url: String): ConfigBuilder
- def overrideWith(props: java.util.Map[_, _]): ConfigBuilder
- def overrideWith(cmdlineArgs: Array[String]): ConfigBuilder
- def param[Type](name: String, description: String, mandatory: Boolean)(implicit mf: Manifest[Type]): ConfigBuilder
- def build(): Config
- }
- trait Config {
- def readProperties(file: String, env: String = EnvironmentResolver()): ConfigPropeties
- def readText(file: String, env: String = EnvironmentResolver(), encoding: Charset = StandardCharsets.UTF_8): String
- def readFile(file: String, env: String = EnvironmentResolver()): InputStream
- def printHelp(w: PrintStream = System.out)
- def knownParams(): Set[String]
- }
- trait ConfigPropeties {
- def props(): Properties
- def map(): Map[String, String]
- def get[Type](key: String): Option[Type]
- def validate(): List[String]
- }
- object ConfigPropeties {
- implicit def toProperties(confProps: ConfigPropeties): Properties = confProps.props()
- }
- object EnvironmentResolver {
- def apply() = ???
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement