mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 14:02:06 +01:00
Enforce valid range for priority.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2412 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
a951bf8ba9
commit
d800f901a9
1 changed files with 6 additions and 1 deletions
|
@ -135,11 +135,16 @@ public class Presence extends Packet {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the priority of the presence.
|
||||
* Sets the priority of the presence. The valid range is -128 through 128.
|
||||
*
|
||||
* @param priority the priority of the presence.
|
||||
* @throws IllegalArgumentException if the priority is outside the valid range.
|
||||
*/
|
||||
public void setPriority(int priority) {
|
||||
if (priority < -128 || priority > 128) {
|
||||
throw new IllegalArgumentException("Priority value " + priority +
|
||||
" is not valid. Valid range is -128 through 128.");
|
||||
}
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue