This will work:
public enum AdCategoryType {
ForSale (1 << 0),
ForBuy (1 << 1),
ForRent (1 << 2),
WantingForRent (1 << 3),
WorkIsWanted (1 << 4),
WorkIsGiven (1 << 5);
private final int value;
private AdCategoryType(int value) {
this.value = value;
}
public int getValue() {
return this.value;
}
};
To get the value ForBuy, use AdCategoryType.ForBuy.getValue().
source
share