Hoplite is a Kotlin library for loading configuration files into typesafe classes in a boilerplate-free way. Define your config using Kotlin data classes, and at startup Hoplite will read from one or more config files, mapping the values in those files into your config classes. Any missing values, or values that cannot be converted into the required type will cause the config to fail with detailed error messages.

Features

  • Write your configuration in several formats: Yaml, JSON, Toml, Hocon, or Java .props files or even mix and match formats in the same system
  • Per-system overrides are possible from JVM system properties, environment variables, JNDI or a per-user local config file
  • Support for many standard types such as primitives, enums, dates, collection types, inline classes, uuids, nullable types, as well as popular Kotlin third party library types such as NonEmptyList, Option and TupleX from Arrow
  • The Decoder interface makes it easy to add support for your custom domain types or standard library types not covered out of the box
  • Config files can be stacked. Start with a default file and then layer new configurations on top. When resolving config, lookup of values falls through to the first file that contains a definition. Can be used to have a default config file and then an environment specific file
  • Fail fast at runtime, with beautiful errors showing exactly what went wrong and where

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

Apache License V2.0

Follow Hoplite

Hoplite Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Hoplite!

Additional Project Details

Operating Systems

Android

Programming Language

Kotlin

Related Categories

Kotlin Libraries

Registered

2024-02-07