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

You Might Also Like
Nectar: Employee Recognition Software to Build Great Culture Icon
Nectar: Employee Recognition Software to Build Great Culture

Nectar is an employee recognition software built for the modern workforce.

Our 360 recognition & rewards platform enables everyone (peer to peer & manager to employees alike) to send meaningful recognition rooted in core values. Nectar has the most extensive rewards catalog so users can choose from company branded swag, Amazon products, gift cards or custom reward types. Integrate with your other tools like Slack and Teams to make sending recognition easy. We support top organizations like MLB, SHRM, Redfin, Heineken and more.
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