Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 24 lines (20 sloc) 0.717 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
import com.google.inject.Inject;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.hibernate.validator.Min;

public class OnMethodOnParamExample {
@Getter(onMethod=@Deprecated) private int bananas;
@Setter(onMethod=@Min(10)) private int radishes;

@Override public String toString() {
return String.format("I have %d bananas and %d beautiful radishes", bananas, radishes);
}
}

@RequiredArgsConstructor(onConstructor=@Inject)
class OnConstructorExample {
private final Fireman fireman;
@Setter(onParam=@SuppressWarnings("all")) private int fires = 10;

@Override public String toString() {
return String.format("Fireman: %s has %d fires", fireman, fires);
}
}
Something went wrong with that request. Please try again.