Say you have type(interface/class) A and A has
A.setX(String x) (and all gets)
A.setY(String y)
.
.
And you have this API:
save(A a);
save method requires A to have X, Y and 10 other values set, but a few other properties are optional. So how can save method tell this kind of requirement to rest of the world?
You can assume that the caller only knows about the signature and documentation of method.