Say you have a method called 'setFloorNumber' that takes an integer that can't be null. Two different ways I figured you could do this:
public void setFloorNumber (@NonNull Integer floor){
...
}
or
public void setFloorNumber (int floor){
...
}
Best I can tell, they both accomplish the same thing which is requiring the integer parameter to not be null.
What are the pros and cons for these?
Is there a reason to want to choose one over the other, or are the differences negligible enough that it's purely just a stylistic choice?