Codota Logo
org.apache.commons.lang3
Code IndexAdd Codota to your IDE (free)

How to use org.apache.commons.lang3

Best Java code snippets using org.apache.commons.lang3 (Showing top 20 results out of 50,337)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Creates a random string whose length is between the inclusive minimum and
 * the exclusive maximum.</p>
 *
 * <p>Characters will be chosen from the set of \p{Print} characters.</p>
 *
 * @param minLengthInclusive the inclusive minimum length of the string to generate
 * @param maxLengthExclusive the exclusive maximum length of the string to generate
 * @return the random string
 * @since 3.5
 */
public static String randomPrint(final int minLengthInclusive, final int maxLengthExclusive) {
  return randomPrint(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive));
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Creates a random string whose length is between the inclusive minimum and
 * the exclusive maximum.</p>
 *
 * <p>Characters will be chosen from the set of Latin alphabetic characters (a-z, A-Z).</p>
 *
 * @param minLengthInclusive the inclusive minimum length of the string to generate
 * @param maxLengthExclusive the exclusive maximum length of the string to generate
 * @return the random string
 * @since 3.5
 */
public static String randomAlphabetic(final int minLengthInclusive, final int maxLengthExclusive) {
  return randomAlphabetic(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive));
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Creates a random string whose length is between the inclusive minimum and
 * the exclusive maximum.</p>
 *
 * <p>Characters will be chosen from the set of \p{Digit} characters.</p>
 *
 * @param minLengthInclusive the inclusive minimum length of the string to generate
 * @param maxLengthExclusive the exclusive maximum length of the string to generate
 * @return the random string
 * @since 3.5
 */
public static String randomNumeric(final int minLengthInclusive, final int maxLengthExclusive) {
  return randomNumeric(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive));
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Checks if an array of primitive booleans is not empty and not {@code null}.
 *
 * @param array  the array to test
 * @return {@code true} if the array is not empty and not {@code null}
 * @since 2.5
 */
public static boolean isNotEmpty(final boolean[] array) {
  return !isEmpty(array);
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Creates a random string whose length is between the inclusive minimum and
 * the exclusive maximum.</p>
 *
 * <p>Characters will be chosen from the set of \p{Graph} characters.</p>
 *
 * @param minLengthInclusive the inclusive minimum length of the string to generate
 * @param maxLengthExclusive the exclusive maximum length of the string to generate
 * @return the random string
 * @since 3.5
 */
public static String randomGraph(final int minLengthInclusive, final int maxLengthExclusive) {
  return randomGraph(RandomUtils.nextInt(minLengthInclusive, maxLengthExclusive));
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Checks if the value is in the given array.
 *
 * <p>The method returns {@code false} if a {@code null} array is passed in.
 *
 * @param array  the array to search through
 * @param valueToFind  the value to find
 * @return {@code true} if the array contains the object
 */
public static boolean contains(final short[] array, final short valueToFind) {
  return indexOf(array, valueToFind) != INDEX_NOT_FOUND;
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Gets the short class name for a class.</p>
 *
 * <p>The short class name is the classname excluding
 * the package name.</p>
 *
 * @param cls  the <code>Class</code> to get the short name of
 * @return the short name
 */
protected String getShortClassName(final Class<?> cls) {
  return ClassUtils.getShortClassName(cls);
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Checks if an array of primitive bytes is empty or {@code null}.
 *
 * @param array  the array to test
 * @return {@code true} if the array is empty or {@code null}
 * @since 2.1
 */
public static boolean isEmpty(final byte[] array) {
  return getLength(array) == 0;
}
origin: org.apache.commons/commons-lang3

private static void init() {
  init_X86_32Bit();
  init_X86_64Bit();
  init_IA64_32Bit();
  init_IA64_64Bit();
  init_PPC_32Bit();
  init_PPC_64Bit();
}
origin: org.apache.commons/commons-lang3

private int run_CharSet(final int loopCount) {
  int t = 0;
  for (int i = 0; i < loopCount; i++) {
    for (final char ch : CHAR_SAMPLES) {
      final boolean b = CharSet.ASCII_NUMERIC.contains(ch);
      t += b ? 1 : 0;
    }
  }
  return t;
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Null-safe version of <code>Class.getName()</code></p>
 *
 * @param object the object for which to get the class name; may be null
 * @return the class name or the empty String
 * @since 3.7
 * @see Class#getSimpleName()
 */
public static String getName(final Object object) {
  return getName(object, StringUtils.EMPTY);
}
origin: org.apache.commons/commons-lang3

/**
 * Compares this mutable to another in ascending order.
 *
 * @param other  the other mutable to compare to, not null
 * @return negative if this is less, zero if equal, positive if greater
 *  where false is less than true
 */
@Override
public int compareTo(final MutableBoolean other) {
  return BooleanUtils.compare(this.value, other.value);
}
origin: org.apache.commons/commons-lang3

/**
 * Decides if the operating system matches.
 *
 * @param osNamePrefix the prefix for the OS name
 * @return true if matches, or false if not or can't determine
 */
private static boolean getOsMatchesName(final String osNamePrefix) {
  return isOSNameMatch(OS_NAME, osNamePrefix);
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Constructs a {@code CharRange} over a single character.</p>
 *
 * @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(final char ch) {
  return new CharRange(ch, ch, false);
}
origin: org.apache.commons/commons-lang3

/**
 * Adds the given {@link Processor} with the given keys to the map.
 *
 * @param keys The keys.
 * @param processor The {@link Processor} to add.
 * @throws IllegalStateException If the key already exists.
 */
private static void addProcessors(final Processor processor, final String... keys) {
  for (final String key : keys) {
    addProcessor(key, processor);
  }
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Checks if an array of primitive ints is not empty and not {@code null}.
 *
 * @param array  the array to test
 * @return {@code true} if the array is not empty and not {@code null}
 * @since 2.5
 */
public static boolean isNotEmpty(final int[] array) {
  return !isEmpty(array);
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Checks if an array of primitive doubles is empty or {@code null}.
 *
 * @param array  the array to test
 * @return {@code true} if the array is empty or {@code null}
 * @since 2.1
 */
public static boolean isEmpty(final double[] array) {
  return getLength(array) == 0;
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Constructs a {@code CharRange} over a set of characters.</p>
 *
 * @param start  first character, inclusive, in this range
 * @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(final char start, final char end) {
  return new CharRange(start, end, false);
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Checks if an array of primitive floats is not empty and not {@code null}.
 *
 * @param array  the array to test
 * @return {@code true} if the array is not empty and not {@code null}
 * @since 2.5
 */
public static boolean isNotEmpty(final float[] array) {
  return !isEmpty(array);
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Constructs a negated {@code CharRange} over a set of characters.</p>
 *
 * @param start  first character, inclusive, in this range
 * @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(final char start, final char end) {
  return new CharRange(start, end, true);
}
org.apache.commons.lang3

Most used classes

  • StringUtils
  • ArrayUtils
  • Pair
  • ToStringBuilder
  • HashCodeBuilder
  • Validate,
  • StringEscapeUtils,
  • ExceptionUtils,
  • ObjectUtils,
  • ImmutablePair,
  • RandomStringUtils,
  • NumberUtils,
  • BooleanUtils,
  • ClassUtils,
  • NotImplementedException,
  • DateUtils,
  • FastDateFormat,
  • WordUtils,
  • SerializationUtils
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now