mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
Rename NumberUtil.checkIfInUInt32Range() to requireUInt32
This commit is contained in:
parent
726a2de273
commit
839e347676
3 changed files with 16 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright © 2015 Florian Schmaus
|
||||
* Copyright © 2015-2019 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -22,8 +22,20 @@ public class NumberUtil {
|
|||
* Checks if the given long is within the range of an unsigned 32-bit integer, the XML type "xs:unsignedInt".
|
||||
*
|
||||
* @param value
|
||||
* @deprecated use {@link #requireUInt32(long)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
// TODO: Remove in Smack 4.5.
|
||||
public static void checkIfInUInt32Range(long value) {
|
||||
requireUInt32(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given long is within the range of an unsigned 32-bit integer, the XML type "xs:unsignedInt".
|
||||
*
|
||||
* @param value
|
||||
*/
|
||||
public static void requireUInt32(long value) {
|
||||
if (value < 0) {
|
||||
throw new IllegalArgumentException("unsigned 32-bit integers can't be negative");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue