| java.lang.Object org.apache.pluto.internal.impl.RandomStringUtils
RandomStringUtils | public class RandomStringUtils (Code) | | Copied from commons-lang. No need for dependency.
Operations for random String s.
since: 1.0 version: $Id: RandomStringUtils.java 516149 2007-03-08 19:10:26Z cziegeler $ |
Constructor Summary | |
public | RandomStringUtils() RandomStringUtils instances should NOT be constructed in
standard programming.
|
Method Summary | |
public static String | random(int count) | public static String | random(int count, boolean letters, boolean numbers) | public static String | random(int count, int start, int end, boolean letters, boolean numbers) | public static String | random(int count, int start, int end, boolean letters, boolean numbers, char[] chars) Creates a random string based on a variety of options, using
default source of randomness.
This method has exactly the same semantics as
RandomStringUtils.random(int,int,int,boolean,boolean,char[],Random) , but
instead of using an externally supplied source of randomness, it uses
the internal static
Random instance.
Parameters: count - the length of random string to create Parameters: start - the position in set of chars to start at Parameters: end - the position in set of chars to end before Parameters: letters - only allow letters? Parameters: numbers - only allow numbers? Parameters: chars - the set of chars to choose randoms from.If null , then it will use the set of all chars. | public static String | random(int count, int start, int end, boolean letters, boolean numbers, char[] chars, Random random) Creates a random string based on a variety of options, using
supplied source of randomness.
If start and end are both 0 , start and end are set
to ' ' and 'z' , the ASCII printable
characters, will be used, unless letters and numbers are both
false , in which case, start and end are set to
0 and Integer.MAX_VALUE .
If set is not null , characters between start and
end are chosen.
This method accepts a user-supplied
Random instance to use as a source of randomness. | public static String | random(int count, String chars) | public static String | random(int count, char[] chars) | public static String | randomAlphabetic(int count) | public static String | randomAlphanumeric(int count) | public static String | randomAscii(int count) | public static String | randomNumeric(int count) |
RandomStringUtils | public RandomStringUtils()(Code) | | RandomStringUtils instances should NOT be constructed in
standard programming. Instead, the class should be used as
RandomStringUtils.random(5); .
This constructor is public to permit tools that require a JavaBean instance
to operate.
|
random | public static String random(int count)(Code) | | Creates a random string whose length is the number of characters
specified.
Characters will be chosen from the set of all characters.
Parameters: count - the length of random string to create the random string |
random | public static String random(int count, boolean letters, boolean numbers)(Code) | | Creates a random string whose length is the number of characters
specified.
Characters will be chosen from the set of alpha-numeric
characters as indicated by the arguments.
Parameters: count - the length of random string to create Parameters: letters - if true , generated string will includealphabetic characters Parameters: numbers - if true , generated string will includenumeric characters the random string |
random | public static String random(int count, int start, int end, boolean letters, boolean numbers)(Code) | | Creates a random string whose length is the number of characters
specified.
Characters will be chosen from the set of alpha-numeric
characters as indicated by the arguments.
Parameters: count - the length of random string to create Parameters: start - the position in set of chars to start at Parameters: end - the position in set of chars to end before Parameters: letters - if true , generated string will includealphabetic characters Parameters: numbers - if true , generated string will includenumeric characters the random string |
random | public static String random(int count, int start, int end, boolean letters, boolean numbers, char[] chars)(Code) | | Creates a random string based on a variety of options, using
default source of randomness.
This method has exactly the same semantics as
RandomStringUtils.random(int,int,int,boolean,boolean,char[],Random) , but
instead of using an externally supplied source of randomness, it uses
the internal static
Random instance.
Parameters: count - the length of random string to create Parameters: start - the position in set of chars to start at Parameters: end - the position in set of chars to end before Parameters: letters - only allow letters? Parameters: numbers - only allow numbers? Parameters: chars - the set of chars to choose randoms from.If null , then it will use the set of all chars. the random string throws: ArrayIndexOutOfBoundsException - if there are not(end - start) + 1 characters in the set array. |
random | public static String random(int count, int start, int end, boolean letters, boolean numbers, char[] chars, Random random)(Code) | | Creates a random string based on a variety of options, using
supplied source of randomness.
If start and end are both 0 , start and end are set
to ' ' and 'z' , the ASCII printable
characters, will be used, unless letters and numbers are both
false , in which case, start and end are set to
0 and Integer.MAX_VALUE .
If set is not null , characters between start and
end are chosen.
This method accepts a user-supplied
Random instance to use as a source of randomness. By seeding a single
Random instance with a fixed seed and using it for each call,
the same random sequence of strings can be generated repeatedly
and predictably.
Parameters: count - the length of random string to create Parameters: start - the position in set of chars to start at Parameters: end - the position in set of chars to end before Parameters: letters - only allow letters? Parameters: numbers - only allow numbers? Parameters: chars - the set of chars to choose randoms from.If null , then it will use the set of all chars. Parameters: random - a source of randomness. the random string throws: ArrayIndexOutOfBoundsException - if there are not(end - start) + 1 characters in the set array. throws: IllegalArgumentException - if count < 0. since: 2.0 |
random | public static String random(int count, String chars)(Code) | | Creates a random string whose length is the number of characters
specified.
Characters will be chosen from the set of characters
specified.
Parameters: count - the length of random string to create Parameters: chars - the String containing the set of characters to use,may be null the random string throws: IllegalArgumentException - if count < 0. |
random | public static String random(int count, char[] chars)(Code) | | Creates a random string whose length is the number of characters
specified.
Characters will be chosen from the set of characters specified.
Parameters: count - the length of random string to create Parameters: chars - the character array containing the set of characters to use,may be null the random string throws: IllegalArgumentException - if count < 0. |
randomAlphabetic | public static String randomAlphabetic(int count)(Code) | | Creates a random string whose length is the number of characters
specified.
Characters will be chosen from the set of alphabetic
characters.
Parameters: count - the length of random string to create the random string |
randomAlphanumeric | public static String randomAlphanumeric(int count)(Code) | | Creates a random string whose length is the number of characters
specified.
Characters will be chosen from the set of alpha-numeric
characters.
Parameters: count - the length of random string to create the random string |
randomAscii | public static String randomAscii(int count)(Code) | | Creates a random string whose length is the number of characters
specified.
Characters will be chosen from the set of characters whose
ASCII value is between 32 and 126 (inclusive).
Parameters: count - the length of random string to create the random string |
randomNumeric | public static String randomNumeric(int count)(Code) | | Creates a random string whose length is the number of characters
specified.
Characters will be chosen from the set of numeric
characters.
Parameters: count - the length of random string to create the random string |
|
|