Git Product home page Git Product logo

crumbprops's Introduction

Badge Icon

CrumbProps

A library to ease using property files.

Java Version

The library is designed to work against Java8. And will stay that way for the forseeable future.

Why?

Because property files are nice, but using them is a pain. Thus I wrote this tool some 10 years ago.

How to use

  1. Create a POJO representing your property file.
public class UserSettings {

    public Integer favouriteNumber;
    
    public Integer secondFavouriteNumber;
    
    public String bestLanguage;
}
  1. Annotate it
@PropertyFile(fileName = user.conf)
public class UserSettings {

    @Property(key = "favourite_number")
    public Integer favouriteNumber;
    
    @Property(key = "second_favourite_number")
    public Integer secondFavouriteNumber;
    
    @Property(key = "best_linguine", defaultValue = "de-CH")
    public String bestLanguage;
}
  1. Load/Save/Whatever you need
UserSettings userSettings = new UserSettings();
PropertyManager pm = new PropertyManager();

//Add settings to a PropertyManager
pm.add(userSettings);

//Load settings from file
pm.load(userSettings);

//Save settings to file
pm.save(userSettings);

Development

Contributors

Report Bugs

If you happen upon bugs and/or behaviour you think is wrong, please report a bug under the Issue-Tracker.

Toolchain

How to contribute

Write code. Make a PR. Explain Why.

Eclipse Setup

run mvn clean eclipse:eclipse -DdownloadSources -DdownloadJavadoc

crumbprops's People

Contributors

dotsp0t avatar mcdonnough avatar

Watchers

 avatar  avatar

crumbprops's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.