Port @since tags from 2.x branch

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916081 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Niall Pemberton 2010-02-25 01:28:13 +00:00
parent 8c16b39c3d
commit 43fca0d749
19 changed files with 69 additions and 23 deletions

View File

@ -455,6 +455,7 @@ public static boolean[] clone(boolean[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static Object[] nullToEmpty(Object[] array) {
if (array == null || array.length == 0) {
@ -474,6 +475,7 @@ public static Object[] nullToEmpty(Object[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static String[] nullToEmpty(String[] array) {
if (array == null || array.length == 0) {
@ -493,6 +495,7 @@ public static String[] nullToEmpty(String[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static long[] nullToEmpty(long[] array) {
if (array == null || array.length == 0) {
@ -512,6 +515,7 @@ public static long[] nullToEmpty(long[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static int[] nullToEmpty(int[] array) {
if (array == null || array.length == 0) {
@ -531,6 +535,7 @@ public static int[] nullToEmpty(int[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static short[] nullToEmpty(short[] array) {
if (array == null || array.length == 0) {
@ -550,6 +555,7 @@ public static short[] nullToEmpty(short[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static char[] nullToEmpty(char[] array) {
if (array == null || array.length == 0) {
@ -569,6 +575,7 @@ public static char[] nullToEmpty(char[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static byte[] nullToEmpty(byte[] array) {
if (array == null || array.length == 0) {
@ -588,6 +595,7 @@ public static byte[] nullToEmpty(byte[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static double[] nullToEmpty(double[] array) {
if (array == null || array.length == 0) {
@ -607,6 +615,7 @@ public static double[] nullToEmpty(double[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static float[] nullToEmpty(float[] array) {
if (array == null || array.length == 0) {
@ -626,6 +635,7 @@ public static float[] nullToEmpty(float[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static boolean[] nullToEmpty(boolean[] array) {
if (array == null || array.length == 0) {
@ -645,6 +655,7 @@ public static boolean[] nullToEmpty(boolean[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static Long[] nullToEmpty(Long[] array) {
if (array == null || array.length == 0) {
@ -664,6 +675,7 @@ public static Long[] nullToEmpty(Long[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static Integer[] nullToEmpty(Integer[] array) {
if (array == null || array.length == 0) {
@ -683,6 +695,7 @@ public static Integer[] nullToEmpty(Integer[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static Short[] nullToEmpty(Short[] array) {
if (array == null || array.length == 0) {
@ -702,6 +715,7 @@ public static Short[] nullToEmpty(Short[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static Character[] nullToEmpty(Character[] array) {
if (array == null || array.length == 0) {
@ -721,6 +735,7 @@ public static Character[] nullToEmpty(Character[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static Byte[] nullToEmpty(Byte[] array) {
if (array == null || array.length == 0) {
@ -740,6 +755,7 @@ public static Byte[] nullToEmpty(Byte[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static Double[] nullToEmpty(Double[] array) {
if (array == null || array.length == 0) {
@ -759,6 +775,7 @@ public static Double[] nullToEmpty(Double[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static Float[] nullToEmpty(Float[] array) {
if (array == null || array.length == 0) {
@ -778,6 +795,7 @@ public static Float[] nullToEmpty(Float[] array) {
*
* @param array the array to check for <code>null</code> or empty
* @return the same array, <code>public static</code> empty array if <code>null</code> or empty input
* @since 2.5
*/
public static Boolean[] nullToEmpty(Boolean[] array) {
if (array == null || array.length == 0) {
@ -3325,7 +3343,7 @@ public static boolean isEmpty(boolean[] array) {
*
* @param array the array to test
* @return <code>true</code> if the array is not empty or not <code>null</code>
*
* @since 2.5
*/
public static <T> boolean isNotEmpty(T[] array) {
return (array != null && array.length != 0);
@ -3336,7 +3354,7 @@ public static <T> boolean isNotEmpty(T[] array) {
*
* @param array the array to test
* @return <code>true</code> if the array is not empty or not <code>null</code>
*
* @since 2.5
*/
public static boolean isNotEmpty(long[] array) {
return (array != null && array.length != 0);
@ -3347,7 +3365,7 @@ public static boolean isNotEmpty(long[] array) {
*
* @param array the array to test
* @return <code>true</code> if the array is not empty or not <code>null</code>
*
* @since 2.5
*/
public static boolean isNotEmpty(int[] array) {
return (array != null && array.length != 0);
@ -3358,7 +3376,7 @@ public static boolean isNotEmpty(int[] array) {
*
* @param array the array to test
* @return <code>true</code> if the array is not empty or not <code>null</code>
*
* @since 2.5
*/
public static boolean isNotEmpty(short[] array) {
return (array != null && array.length != 0);
@ -3369,7 +3387,7 @@ public static boolean isNotEmpty(short[] array) {
*
* @param array the array to test
* @return <code>true</code> if the array is not empty or not <code>null</code>
*
* @since 2.5
*/
public static boolean isNotEmpty(char[] array) {
return (array != null && array.length != 0);
@ -3380,7 +3398,7 @@ public static boolean isNotEmpty(char[] array) {
*
* @param array the array to test
* @return <code>true</code> if the array is not empty or not <code>null</code>
*
* @since 2.5
*/
public static boolean isNotEmpty(byte[] array) {
return (array != null && array.length != 0);
@ -3391,7 +3409,7 @@ public static boolean isNotEmpty(byte[] array) {
*
* @param array the array to test
* @return <code>true</code> if the array is not empty or not <code>null</code>
*
* @since 2.5
*/
public static boolean isNotEmpty(double[] array) {
return (array != null && array.length != 0);
@ -3402,7 +3420,7 @@ public static boolean isNotEmpty(double[] array) {
*
* @param array the array to test
* @return <code>true</code> if the array is not empty or not <code>null</code>
*
* @since 2.5
*/
public static boolean isNotEmpty(float[] array) {
return (array != null && array.length != 0);
@ -3413,7 +3431,7 @@ public static boolean isNotEmpty(float[] array) {
*
* @param array the array to test
* @return <code>true</code> if the array is not empty or not <code>null</code>
*
* @since 2.5
*/
public static boolean isNotEmpty(boolean[] array) {
return (array != null && array.length != 0);

View File

@ -83,6 +83,7 @@ private CharRange(char start, char end, boolean negated) {
* @param ch only character in this range
* @return the new CharRange object
* @see CharRange#CharRange(char, char, boolean)
* @since 2.5
*/
public static CharRange is(char ch) {
return new CharRange(ch, ch, false);
@ -94,6 +95,7 @@ public static CharRange is(char ch) {
* @param ch only character in this range
* @return the new CharRange object
* @see CharRange#CharRange(char, char, boolean)
* @since 2.5
*/
public static CharRange isNot(char ch) {
return new CharRange(ch, ch, true);
@ -106,6 +108,7 @@ public static CharRange isNot(char ch) {
* @param end last character, inclusive, in this range
* @return the new CharRange object
* @see CharRange#CharRange(char, char, boolean)
* @since 2.5
*/
public static CharRange isIn(char start, char end) {
return new CharRange(start, end, false);
@ -118,6 +121,7 @@ public static CharRange isIn(char start, char end) {
* @param end last character, inclusive, in this range
* @return the new CharRange object
* @see CharRange#CharRange(char, char, boolean)
* @since 2.5
*/
public static CharRange isNotIn(char start, char end) {
return new CharRange(start, end, true);
@ -250,6 +254,7 @@ public String toString() {
* <p>Returns an iterator which can be used to walk through the characters described by this range.</p>
*
* @return an iterator to the chars represented by this range
* @since 2.5
*/
public Iterator<Character> iterator() {
return new CharacterIterator(this);

View File

@ -949,7 +949,7 @@ private static int ordinalIndexOf(String str, String searchStr, int ordinal, boo
* @param searchStr the String to find, may be null
* @return the first index of the search String,
* -1 if no match or <code>null</code> string input
* @since 3.0
* @since 2.5
*/
public static int indexOfIgnoreCase(String str, String searchStr) {
return indexOfIgnoreCase(str, searchStr, 0);
@ -984,7 +984,7 @@ public static int indexOfIgnoreCase(String str, String searchStr) {
* @param startPos the start position, negative treated as zero
* @return the first index of the search String,
* -1 if no match or <code>null</code> string input
* @since 3.0
* @since 2.5
*/
public static int indexOfIgnoreCase(String str, String searchStr, int startPos) {
if (str == null || searchStr == null) {
@ -1130,7 +1130,7 @@ public static int lastIndexOf(String str, String searchStr) {
* @param ordinal the n-th last <code>searchStr</code> to find
* @return the n-th last index of the search String,
* <code>-1</code> (<code>INDEX_NOT_FOUND</code>) if no match or <code>null</code> string input
* @since 3.0
* @since 2.5
*/
public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal) {
return ordinalIndexOf(str, searchStr, ordinal, true);
@ -1191,7 +1191,7 @@ public static int lastIndexOf(String str, String searchStr, int startPos) {
* @param searchStr the String to find, may be null
* @return the first index of the search String,
* -1 if no match or <code>null</code> string input
* @since 3.0
* @since 2.5
*/
public static int lastIndexOfIgnoreCase(String str, String searchStr) {
if (str == null || searchStr == null) {
@ -1226,7 +1226,7 @@ public static int lastIndexOfIgnoreCase(String str, String searchStr) {
* @param startPos the start position
* @return the first index of the search String,
* -1 if no match or <code>null</code> string input
* @since 3.0
* @since 2.5
*/
public static int lastIndexOfIgnoreCase(String str, String searchStr, int startPos) {
if (str == null || searchStr == null) {
@ -4272,6 +4272,7 @@ public static String chop(String str) {
* @param repeat number of times to repeat str, negative treated as zero
* @return a new String consisting of the original String repeated,
* <code>null</code> if null String input
* @since 2.5
*/
public static String repeat(String str, int repeat) {
// Performance tuned for 2.0 (JDK1.4)
@ -4768,7 +4769,7 @@ public static String upperCase(String str) {
* @param str the String to upper case, may be null
* @param locale the locale that defines the case transformation rules, must not be null
* @return the upper cased String, <code>null</code> if null String input
* @since 3.0
* @since 2.5
*/
public static String upperCase(String str, Locale locale) {
if (str == null) {
@ -4817,7 +4818,7 @@ public static String lowerCase(String str) {
* @param str the String to lower case, may be null
* @param locale the locale that defines the case transformation rules, must not be null
* @return the lower cased String, <code>null</code> if null String input
* @since 3.0
* @since 2.5
*/
public static String lowerCase(String str, Locale locale) {
if (str == null) {
@ -5261,6 +5262,7 @@ public static boolean isWhitespace(String str) {
*
* @param str the String to check, may be null
* @return <code>true</code> if only contains lowercase characters, and is non-null
* @since 2.5
*/
public static boolean isAllLowerCase(String str) {
if (str == null || isEmpty(str)) {
@ -5291,6 +5293,7 @@ public static boolean isAllLowerCase(String str) {
*
* @param str the String to check, may be null
* @return <code>true</code> if only contains uppercase characters, and is non-null
* @since 2.5
*/
public static boolean isAllUpperCase(String str) {
if (str == null || isEmpty(str)) {
@ -5550,6 +5553,7 @@ public static String abbreviate(String str, int offset, int maxWidth) {
* @param middle the String to replace the middle characters with, may be null
* @param length the length to abbreviate <code>str</code> to.
* @return the abbreviated String if the above criteria is met, or the original String supplied for abbreviation.
* @since 2.5
*/
public static String abbreviateMiddle(String str, String middle, int length) {
if (isEmpty(str) || isEmpty(middle)) {
@ -6021,7 +6025,7 @@ private static boolean startsWith(String str, String prefix, boolean ignoreCase)
* @param searchStrings the Strings to find, may be null or empty
* @return <code>true</code> if the String starts with any of the the prefixes, case insensitive, or
* both <code>null</code>
* @since 3.0
* @since 2.5
*/
public static boolean startsWithAny(String string, String[] searchStrings) {
if (isEmpty(string) || ArrayUtils.isEmpty(searchStrings)) {

View File

@ -841,6 +841,7 @@ protected void setEquals(boolean isEquals) {
/**
* Reset the EqualsBuilder so you can use the same object again
* @since 2.5
*/
public void reset() {
this.isEquals = true;

View File

@ -984,6 +984,7 @@ public int toHashCode() {
* HashCodeBuilder itself is.
*
* @return <code>hashCode</code> based on the fields appended
* @since 2.5
*/
@Override
public int hashCode() {

View File

@ -304,6 +304,7 @@ public static double toDouble(String str, double defaultValue) {
* @param str the string to convert, may be null
* @return the byte represented by the string, or <code>zero</code> if
* conversion fails
* @since 2.5
*/
public static byte toByte(String str) {
return toByte(str, (byte) 0);
@ -324,6 +325,7 @@ public static byte toByte(String str) {
* @param str the string to convert, may be null
* @param defaultValue the default value
* @return the byte represented by the string, or the default if conversion fails
* @since 2.5
*/
public static byte toByte(String str, byte defaultValue) {
if(str == null) {
@ -351,6 +353,7 @@ public static byte toByte(String str, byte defaultValue) {
* @param str the string to convert, may be null
* @return the short represented by the string, or <code>zero</code> if
* conversion fails
* @since 2.5
*/
public static short toShort(String str) {
return toShort(str, (short) 0);
@ -371,6 +374,7 @@ public static short toShort(String str) {
* @param str the string to convert, may be null
* @param defaultValue the default value
* @return the short represented by the string, or the default if conversion fails
* @since 2.5
*/
public static short toShort(String str, short defaultValue) {
if(str == null) {

View File

@ -101,6 +101,7 @@ public void setValue(Boolean value) {
* Checks if the current value is <code>true</code>.
*
* @return <code>true</code> if the current value is <code>true</code>
* @since 2.5
*/
public boolean isTrue() {
return value == true;
@ -110,6 +111,7 @@ public boolean isTrue() {
* Checks if the current value is <code>false</code>.
*
* @return <code>true</code> if the current value is <code>false</code>
* @since 2.5
*/
public boolean isFalse() {
return value == false;
@ -130,6 +132,7 @@ public boolean booleanValue() {
* Gets this mutable as an instance of Boolean.
*
* @return a Boolean instance containing the value from this mutable, never null
* @since 2.5
*/
public Boolean toBoolean() {
return Boolean.valueOf(booleanValue());

View File

@ -69,6 +69,7 @@ public MutableByte(Number value) {
*
* @param value the string to parse, not null
* @throws NumberFormatException if the string cannot be parsed into a byte
* @since 2.5
*/
public MutableByte(String value) throws NumberFormatException {
super();

View File

@ -69,6 +69,7 @@ public MutableDouble(Number value) {
*
* @param value the string to parse, not null
* @throws NumberFormatException if the string cannot be parsed into a double
* @since 2.5
*/
public MutableDouble(String value) throws NumberFormatException {
super();

View File

@ -69,6 +69,7 @@ public MutableFloat(Number value) {
*
* @param value the string to parse, not null
* @throws NumberFormatException if the string cannot be parsed into a float
* @since 2.5
*/
public MutableFloat(String value) throws NumberFormatException {
super();

View File

@ -69,6 +69,7 @@ public MutableInt(Number value) {
*
* @param value the string to parse, not null
* @throws NumberFormatException if the string cannot be parsed into an int
* @since 2.5
*/
public MutableInt(String value) throws NumberFormatException {
super();

View File

@ -69,6 +69,7 @@ public MutableLong(Number value) {
*
* @param value the string to parse, not null
* @throws NumberFormatException if the string cannot be parsed into a long
* @since 2.5
*/
public MutableLong(String value) throws NumberFormatException {
super();

View File

@ -69,6 +69,7 @@ public MutableShort(Number value) {
*
* @param value the string to parse, not null
* @throws NumberFormatException if the string cannot be parsed into a short
* @since 2.5
*/
public MutableShort(String value) throws NumberFormatException {
super();

View File

@ -47,7 +47,7 @@
* @author Jan Sorensen
* @author Robert Burrell Donkin
* @author Rodney Waldhoff
* @since 3.0
* @since 2.5
* @version $Id$
*/
public class ConstructorUtils {

View File

@ -32,7 +32,7 @@
*
* @author Apache Software Foundation
* @author Matt Benson
* @since 3.0
* @since 2.5
* @version $Id$
*/
public class FieldUtils {

View File

@ -30,7 +30,7 @@
* @author Apache Software Foundation
* @author Steve Cohen
* @author Matt Benson
* @since 3.0
* @since 2.5
* @version $Id$
*/
abstract class MemberUtils {

View File

@ -50,7 +50,7 @@
* @author Jan Sorensen
* @author Robert Burrell Donkin
* @author Matt Benson
* @since 3.0
* @since 2.5
* @version $Id$
*/
public class MethodUtils {

View File

@ -1124,7 +1124,7 @@ public StrBuilder appendSeparator(String separator) {
* @param standard the separator if builder is not empty, null means no separator
* @param defaultIfEmpty the separator if builder is empty, null means no separator
* @return this, to enable chaining
* @since 3.0
* @since 2.5
*/
public StrBuilder appendSeparator(String standard, String defaultIfEmpty) {
String str = isEmpty() ? defaultIfEmpty : standard;
@ -1169,7 +1169,7 @@ public StrBuilder appendSeparator(char separator) {
* @param standard the separator if builder is not empty
* @param defaultIfEmpty the separator if builder is empty
* @return this, to enable chaining
* @since 3.0
* @since 2.5
*/
public StrBuilder appendSeparator(char standard, char defaultIfEmpty) {
if (size() > 0) {

View File

@ -301,6 +301,7 @@ public static Date parseDate(String str, String[] parsePatterns) throws ParseExc
* @return the parsed date
* @throws IllegalArgumentException if the date string or pattern array is null
* @throws ParseException if none of the date patterns were suitable
* @since 2.5
*/
public static Date parseDateStrictly(String str, String[] parsePatterns) throws ParseException {
return parseDateWithLeniency(str, parsePatterns, false);
@ -840,6 +841,7 @@ public static Date truncate(Object date, int field) {
* @return the rounded date
* @throws IllegalArgumentException if the date is <code>null</code>
* @throws ArithmeticException if the year is over 280 million
* @since 2.5
*/
public static Date ceiling(Date date, int field) {
if (date == null) {
@ -866,6 +868,7 @@ public static Date ceiling(Date date, int field) {
* @return the rounded date (a different object)
* @throws IllegalArgumentException if the date is <code>null</code>
* @throws ArithmeticException if the year is over 280 million
* @since 2.5
*/
public static Calendar ceiling(Calendar date, int field) {
if (date == null) {
@ -895,6 +898,7 @@ public static Calendar ceiling(Calendar date, int field) {
* @throws ClassCastException if the object type is not a
* <code>Date</code> or <code>Calendar</code>
* @throws ArithmeticException if the year is over 280 million
* @since 2.5
*/
public static Date ceiling(Object date, int field) {
if (date == null) {