@ArezComponent
public class Counter {
private int count;
@Observable
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
@Action
public void incrementCount() {
setCount(getCount() + 1);
}
}
@ArezComponent
public class ComputedPropertyExample {
private int a;
private int b;
@Observable
public int getA() {
return a;
}
public void setA(int a) {
this.a = a;
}
@Observable
public int getB() {
return b;
}
public void setB(int b) {
this.b = b;
}
@Computed
public int getSum() {
return getA() + getB();
}
}