Delegated property for java.
Val<Integer> lazyVal = new Variables.Lazy<Integer>() {
@Override public Integer create() {
return some calculation;
}
};
int value = lazyVal.get();
Var<Integer> observableVar = new Variables.Observable<Integer>(0) {
@Override public void onChange(Integer oldValue, Integer newValue) {
do your thing;
}
};
observableVar.set(1);
Available via JitPack.
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
compile 'com.github.moomoon:variables:1.0.1'
}