Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/apache/commons-lang
/ functions
Functions
9,093 in github.com/apache/commons-lang
⨍
Functions
9,093
◇
Types & classes
1,098
↓ 43 callers
Method
equals
(final Object o)
src/test/java/org/apache/commons/lang3/tuple/PairTest.java:150
↓ 43 callers
Method
hashCode
Gets a hashCode compatible with the equals method. @return a suitable hashCode.
src/main/java/org/apache/commons/lang3/CharRange.java:319
↓ 43 callers
Method
replaceIgnoreCase
Case insensitively replaces all occurrences of a String within another String. <p> A {@code null} reference passed to this method is a no-op. </p> <
src/main/java/org/apache/commons/lang3/StringUtils.java:6716
↓ 43 callers
Method
writeStaticField
Writes a named {@code public static} {@link Field}. Superclasses will be considered. @param cls {@link Class} on which the field is to be
src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java:850
↓ 42 callers
Method
formatDurationWords
Formats an elapsed time into a pluralization correct string. <p> This method formats durations using the days and lower fields of the format pattern.
src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java:436
↓ 41 callers
Method
isSorted
Tests whether whether the provided array is sorted according to natural ordering ({@code false} before {@code true}). @param array the array to check
src/main/java/org/apache/commons/lang3/ArrayUtils.java:3875
↓ 40 callers
Method
applyNonNull
Applies a value to a function if the value isn't {@code null}, otherwise the method returns {@code null}. If the value isn't {@code null} then return
src/main/java/org/apache/commons/lang3/function/Failable.java:205
↓ 40 callers
Method
length
()
src/test/java/org/apache/commons/lang3/builder/EqualsBuilderReflectJreImplementationTest.java:79
↓ 40 callers
Method
negate
Returns a predicate that negates this predicate. @return a predicate that negates this predicate.
src/main/java/org/apache/commons/lang3/function/FailablePredicate.java:82
↓ 40 callers
Method
setByteBoolean
Sets a boolean BitField. @param holder the byte data containing the bits we're interested in. @param flag indicating whether to set or clear the bi
src/main/java/org/apache/commons/lang3/BitField.java:335
↓ 40 callers
Method
setThrowable
(final Throwable throwable)
src/test/java/org/apache/commons/lang3/FunctionsTest.java:160
↓ 40 callers
Method
toScaledBigDecimal
Converts a {@link BigDecimal} to a {@link BigDecimal} with a scale of two that has been rounded using {@code RoundingMode.HALF_EVEN}. If the supplied
src/main/java/org/apache/commons/lang3/math/NumberUtils.java:1504
↓ 39 callers
Method
applyAsDouble
Applies this function to the given arguments. @param t the first function argument @return the function result @throws E Thrown when the function fai
src/main/java/org/apache/commons/lang3/function/FailableToDoubleFunction.java:55
↓ 39 callers
Method
applyAsInt
Applies this function to the given arguments. @param t the first function argument @return the function result @throws E Thrown when the function fai
src/main/java/org/apache/commons/lang3/function/FailableToIntFunction.java:55
↓ 39 callers
Method
ensureCapacity
Checks the capacity and ensures that it is at least the size specified. @param capacity the capacity to ensure. @return {@code this} instance.
src/main/java/org/apache/commons/lang3/text/StrBuilder.java:1850
↓ 39 callers
Method
random
Creates a random string whose length is the number of characters specified. <p> Characters will be chosen from the set of all characters. </p> @para
src/main/java/org/apache/commons/lang3/RandomStringUtils.java:134
↓ 39 callers
Method
repeat
Returns padding using the specified delimiter repeated to a given length. <pre> StringUtils.repeat('e', 0) = "" StringUtils.repeat('e', 3) = "eee"
src/main/java/org/apache/commons/lang3/StringUtils.java:6120
↓ 38 callers
Method
applyAsLong
Applies this function to the given arguments. @param t the first function argument @return the function result @throws E Thrown when the function fai
src/main/java/org/apache/commons/lang3/function/FailableToLongFunction.java:55
↓ 38 callers
Method
center
Centers a String in a larger String of size {@code size} using the space character (' '). <p> If the size is less than the String length, the origina
src/main/java/org/apache/commons/lang3/StringUtils.java:588
↓ 38 callers
Method
clone
()
src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java:83
↓ 38 callers
Method
fit
Fits the given element into this range by returning the given element or, if out of bounds, the range minimum if below, or the range maximum if above.
src/main/java/org/apache/commons/lang3/Range.java:347
↓ 38 callers
Method
getDimensions
Gets the number of dimensions of an array. <p> The <a href="https://docs.oracle.com/javase/specs/jvms/se25/html/jvms-4.html#jvms-4.3">JVM specificatio
src/main/java/org/apache/commons/lang3/ArrayUtils.java:2149
↓ 38 callers
Method
inclusiveBetween
Validate that the specified primitive value falls between the two inclusive values specified; otherwise, throws an exception. <pre>Validate.inclusive
src/main/java/org/apache/commons/lang3/Validate.java:270
↓ 38 callers
Method
isNaN
Checks whether the float value is the special NaN value. @return true if NaN.
src/main/java/org/apache/commons/lang3/mutable/MutableFloat.java:342
↓ 38 callers
Method
iterator
()
src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java:206
↓ 38 callers
Method
max
Null safe comparison of Comparables. <p> TODO Move to ComparableUtils. </p> @param <T> type of the values processed by this method. @param values
src/main/java/org/apache/commons/lang3/ObjectUtils.java:1030
↓ 38 callers
Method
of
Delegates to {@link Collection#stream()} or returns {@link Stream#empty()} if the collection is null. @param <E> The type of elements in the collecti
src/main/java/org/apache/commons/lang3/stream/Streams.java:675
↓ 38 callers
Method
startsWith
Tests if a CharSequence starts with a specified prefix. <p> {@code null}s are handled without exceptions. Two {@code null} references are considered
src/main/java/org/apache/commons/lang3/Strings.java:1422
↓ 37 callers
Method
add
Adds the value of this fraction to another, returning the result in reduced form. The algorithm follows Knuth, 4.5.1. @param fraction the fraction t
src/main/java/org/apache/commons/lang3/math/Fraction.java:505
↓ 37 callers
Method
assertFalseIfAccessible
(final boolean test)
src/test/java/org/apache/commons/lang3/builder/AbstractBuilderTest.java:47
↓ 37 callers
Method
containsTypeVariables
Tests, recursively, whether any of the type parameters associated with {@code type} are bound to variables. @param type The type to check for type va
src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java:373
↓ 37 callers
Method
fill
Fills and returns the given array, assigning the given {@code boolean} value to each element of the array. @param a the array to fill (may be null)
src/main/java/org/apache/commons/lang3/ArrayFill.java:97
↓ 37 callers
Method
generateBitVectors
Creates a bit vector representation of the given subset of an Enum using as many {@code long}s as needed. <p>This generates a value that is usable by
src/main/java/org/apache/commons/lang3/EnumUtils.java:148
↓ 37 callers
Method
getDeclaredMethod
(final String name, final Class<?>... parameterTypes)
src/test/java/org/apache/commons/lang3/function/MethodFixtures.java:31
↓ 37 callers
Method
of
(final double min, final double max)
src/test/java/org/apache/commons/lang3/DoubleRangeTest.java:40
↓ 37 callers
Method
of
(final int min, final int max)
src/test/java/org/apache/commons/lang3/IntegerRangeTest.java:41
↓ 37 callers
Method
of
Creates an immutable pair of two objects inferring the generic types. @param <L> The left element type. @param <R> The right element type. @param lef
src/main/java/org/apache/commons/lang3/tuple/ImmutablePair.java:105
↓ 37 callers
Method
oneHot
Performs a one-hot on an array of booleans. <p> This implementation returns true if one, and only one, of the supplied values is true. </p> <p> See al
src/main/java/org/apache/commons/lang3/BooleanUtils.java:285
↓ 37 callers
Method
removeAll
Removes each substring of the text String that matches the given regular expression pattern. This method is a {@code null} safe equivalent to: <ul>
src/main/java/org/apache/commons/lang3/RegExUtils.java:108
↓ 36 callers
Method
accept
Consumes a consumer and rethrows any exception as a {@link RuntimeException}. @param consumer the consumer to accept, may be null for a noop. @param
src/main/java/org/apache/commons/lang3/function/Failable.java:85
↓ 36 callers
Method
add
Adds to a date returning a new object. The original {@link Date} is unchanged. @param date the date, not null. @param calendarField the calendar fi
src/main/java/org/apache/commons/lang3/time/DateUtils.java:222
↓ 36 callers
Method
byteValue
Returns the value of this MutableByte as a byte. @return the numeric value represented by this object after conversion to type byte.
src/main/java/org/apache/commons/lang3/mutable/MutableByte.java:136
↓ 36 callers
Method
getNumberOfDiffs
Gets the number of differences between the two objects. @return the number of differences
src/main/java/org/apache/commons/lang3/builder/DiffResult.java:104
↓ 36 callers
Method
indexOfThrowable
Returns the (zero-based) index of the first {@link Throwable} that matches the specified class (exactly) in the exception chain. Subclasses of the spe
src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java:617
↓ 36 callers
Method
indexOfType
Returns the (zero-based) index of the first {@link Throwable} that matches the specified class or subclass in the exception chain. Subclasses of the s
src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java:654
↓ 36 callers
Method
intersects
Returns true if the specified {@link BitSet} has any bits set to {@code true} that are also set to {@code true} in this {@link BitSet}. @param set {@
src/main/java/org/apache/commons/lang3/util/FluentBitSet.java:280
↓ 36 callers
Method
isEmpty
Checks is the string builder is empty (convenience Collections API style method). <p> This method is the same as checking {@link #length()} and is pro
src/main/java/org/apache/commons/lang3/text/StrBuilder.java:2306
↓ 36 callers
Method
lastIndexOfIgnoreCase
Case insensitive find of the last index within a CharSequence. <p> A {@code null} CharSequence will return {@code -1}. A negative start position retu
src/main/java/org/apache/commons/lang3/StringUtils.java:5037
↓ 36 callers
Method
notEmpty
<p>Validates that the specified argument collection is neither {@code null} nor a size of zero (no elements); otherwise throwing an exception. <pre>V
src/main/java/org/apache/commons/lang3/Validate.java:828
↓ 36 callers
Method
replaceChars
Replaces all occurrences of a character in a String with another. This is a null-safe version of {@link String#replace(char, char)}. <p> A {@code nul
src/main/java/org/apache/commons/lang3/StringUtils.java:6347
↓ 36 callers
Method
shortValue
Returns the value of this MutableShort as a short. @return the numeric value represented by this object after conversion to type short.
src/main/java/org/apache/commons/lang3/mutable/MutableShort.java:342
↓ 36 callers
Method
singletonArray
(final Class<?> c)
src/test/java/org/apache/commons/lang3/reflect/ConstructorUtilsTest.java:147
↓ 36 callers
Method
throwableOfThrowable
Returns the first {@link Throwable} that matches the specified class (exactly) in the exception chain. Subclasses of the specified class do not match
src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java:955
↓ 36 callers
Method
throwableOfType
Returns the throwable of the first {@link Throwable} that matches the specified class or subclass in the exception chain. Subclasses of the specified
src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java:995
↓ 36 callers
Method
writeDeclaredField
Writes a {@code public} {@link Field}. Only the specified class will be considered. @param target the object to reflect, must not be {@cod
src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java:639
↓ 35 callers
Method
accept
Consumes a consumer and rethrows any exception as a {@link RuntimeException}. @param consumer the consumer to consume @param object1 the first object
src/main/java/org/apache/commons/lang3/Functions.java:296
↓ 35 callers
Method
addFirst
Copies the given array and adds the given element at the beginning of the new array. <p> The new array contains the same elements of the input array p
src/main/java/org/apache/commons/lang3/ArrayUtils.java:1206
↓ 35 callers
Method
assertEqualDuration
(final String expected, final int[] start, final int[] end, final String format)
src/test/java/org/apache/commons/lang3/time/DurationFormatUtilsTest.java:68
↓ 35 callers
Method
generateBitVector
Creates a long bit vector representation of the given array of Enum values. <p>This generates a value that is usable by {@link EnumUtils#processBitVe
src/main/java/org/apache/commons/lang3/EnumUtils.java:97
↓ 35 callers
Method
replace
Replaces all occurrences of a String within another String. <p> A {@code null} reference passed to this method is a no-op. </p> <pre> StringUtils.re
src/main/java/org/apache/commons/lang3/StringUtils.java:6237
↓ 35 callers
Method
toString
Formats a given type as a Java-esque String. @param type the type to create a String representation for, not {@code null}. @return String. @throws Nu
src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java:1560
↓ 34 callers
Method
bitSet
Gets the wrapped bit set. @return the wrapped bit set.
src/main/java/org/apache/commons/lang3/util/FluentBitSet.java:127
↓ 34 callers
Method
exclusiveBetween
Validate that the specified primitive value falls between the two exclusive values specified; otherwise, throws an exception. <pre>Validate.exclusive
src/main/java/org/apache/commons/lang3/Validate.java:93
↓ 34 callers
Method
isArrayType
Tests whether the specified type denotes an array type. @param type the type to be checked. @return {@code true} if {@code type} is an array class or
src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java:936
↓ 34 callers
Method
isNotEmpty
Tests whether 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
src/main/java/org/apache/commons/lang3/ArrayUtils.java:3643
↓ 34 callers
Method
stream
Converts the given {@link Collection} into a {@link FailableStream}. This is basically a simplified, reduced version of the {@link Stream} class, with
src/main/java/org/apache/commons/lang3/Streams.java:506
↓ 34 callers
Method
toString
Gets the {@code toString()} of an {@link Object} or the empty string ({@code ""}) if the input is {@code null}. <pre> ObjectUtils.toString(null)
src/main/java/org/apache/commons/lang3/ObjectUtils.java:1235
↓ 34 callers
Method
wrapIfMissing
Wraps a string with a char if that char is missing from the start or end of the given string. <p> A new {@link String} will not be created if {@code
src/main/java/org/apache/commons/lang3/StringUtils.java:9287
↓ 34 callers
Method
xor
Performs an xor on a set of booleans. <p> This behaves like an XOR gate; it returns true if the number of true values is odd, and false if the n
src/main/java/org/apache/commons/lang3/BooleanUtils.java:1179
↓ 33 callers
Method
contains
Checks if the string builder contains the specified char. @param ch the character to find. @return true if the builder contains the character.
src/main/java/org/apache/commons/lang3/text/StrBuilder.java:1627
↓ 33 callers
Method
containsOnly
Tests if the CharSequence contains only certain characters. <p> A {@code null} CharSequence will return {@code false}. A {@code null} valid character
src/main/java/org/apache/commons/lang3/StringUtils.java:1320
↓ 33 callers
Method
createTokenWithCount
(final CharSequence value, final int count)
src/test/java/org/apache/commons/lang3/time/DurationFormatUtilsTest.java:115
↓ 33 callers
Method
get
Transforms the given string with a Java version number to the corresponding constant of this enumeration class. This method is used internally. @para
src/main/java/org/apache/commons/lang3/JavaVersion.java:226
↓ 33 callers
Method
getPackageCanonicalName
Gets the package name from the canonical name of a {@link Class}. @param cls the class to get the package name for, may be {@code null}. @return the
src/main/java/org/apache/commons/lang3/ClassUtils.java:735
↓ 33 callers
Method
getProcessor
Gets a {@link Processor} object of the current JVM. <p> Important: The {@code "os.arch"} system property returns the architecture used by the JVM not
src/main/java/org/apache/commons/lang3/ArchUtils.java:76
↓ 33 callers
Method
of
Creates an immutable triple of three objects inferring the generic types. @param <L> The left element type. @param <M> The middle element type. @para
src/main/java/org/apache/commons/lang3/tuple/ImmutableTriple.java:96
↓ 33 callers
Method
reflectionHashCode
Uses reflection to build a valid hash code from the fields of {@code object}. <p> It uses {@code AccessibleObject.setAccessible} to gain access to pr
src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java:297
↓ 33 callers
Method
sort
Sorts the given array into ascending order and returns it. @param array the array to sort (may be null). @return the given array. @see Arrays#sort(by
src/main/java/org/apache/commons/lang3/ArraySorter.java:38
↓ 32 callers
Method
compose
Returns a composed {@link FailableFunction} like {@link Function#compose(Function)}. @param <V> The input type to the {@code before} function, and to
src/main/java/org/apache/commons/lang3/function/FailableFunction.java:107
↓ 32 callers
Method
getCause
Introspects the {@link Throwable} to obtain the cause. <p> The method searches for methods with specific names that return a {@link Throwable} object
src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java:213
↓ 32 callers
Method
getRawOffset
()
src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java:84
↓ 32 callers
Method
indexOfDifference
Compares all CharSequences in an array and returns the index at which the CharSequences begin to differ. <p> For example, {@code indexOfDifference(ne
src/main/java/org/apache/commons/lang3/StringUtils.java:2974
↓ 32 callers
Method
isAfterRange
Checks whether this range is completely after the specified range. <p>This method may fail if the ranges have two different comparators or element ty
src/main/java/org/apache/commons/lang3/Range.java:442
↓ 32 callers
Method
unwrap
Unwraps a given string from a character. <pre> StringUtils.unwrap(null, null) = null StringUtils.unwrap(null, '\0') = null StringUtil
src/main/java/org/apache/commons/lang3/StringUtils.java:9096
↓ 31 callers
Method
contains
Tests if CharSequence contains a search CharSequence, handling {@code null}. This method uses {@link String#indexOf(String)} if possible. <p>A {@code
src/main/java/org/apache/commons/lang3/StringUtils.java:1019
↓ 31 callers
Method
parameterize
Creates a parameterized type instance. @param rawClass the raw class to create a parameterized type instance for. @param typeVariableMap the m
src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java:1411
↓ 31 callers
Method
removeFirst
Removes the first substring of the text string that matches the given regular expression pattern. This method is a {@code null} safe equivalent to: <
src/main/java/org/apache/commons/lang3/RegExUtils.java:229
↓ 31 callers
Method
translate
{@inheritDoc}
src/main/java/org/apache/commons/lang3/text/translate/UnicodeEscaper.java:124
↓ 31 callers
Method
verify
Verifies that change events for the expected values have been received. @param values the expected values
src/test/java/org/apache/commons/lang3/concurrent/EventCountCircuitBreakerTest.java:78
↓ 30 callers
Method
appendDetail
Appends to the {@code toString} a {@code boolean} value. @param buffer the {@link StringBuffer} to populate. @param fieldName the field name, typi
src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java:1104
↓ 30 callers
Method
binaryToHexDigit
Converts binary (represented as boolean array) to a hexadecimal digit using the default (LSB0) bit ordering. <p> (1, 0, 0, 0) is converted as follow:
src/main/java/org/apache/commons/lang3/Conversion.java:188
↓ 30 callers
Method
diff
(final TypeTestClass obj)
src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java:91
↓ 30 callers
Method
getArrayComponentType
Gets the array component type of {@code type}. @param type the type to be checked. @return component type or null if type is not an array type.
src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java:593
↓ 30 callers
Method
getOsNameMatches
Tests if the operating system matches the given string with a case-insensitive comparison. <p> The result depends on the value of the {@link #OS_NAME}
src/main/java/org/apache/commons/lang3/SystemUtils.java:2243
↓ 30 callers
Method
getPattern
Gets the pattern used by this parser. @return the pattern, {@link java.text.SimpleDateFormat} compatible.
src/main/java/org/apache/commons/lang3/time/DateParser.java:51
↓ 30 callers
Method
getRawValue
Gets the value for the specified BitField, unshifted. @param holder the int data containing the bits we're interested in. @return the selected bits.
src/main/java/org/apache/commons/lang3/BitField.java:147
↓ 30 callers
Method
hasNext
()
src/main/java/org/apache/commons/lang3/ClassUtils.java:1210
↓ 30 callers
Method
or
Performs an 'or' operation on a set of booleans. <pre> BooleanUtils.or(true, true) = true BooleanUtils.or(false, false) = false
src/main/java/org/apache/commons/lang3/BooleanUtils.java:338
↓ 30 callers
Method
set
Sets the bits. @param holder the int data containing the bits we're interested in. @return the value of holder with the specified bits set to {@code
src/main/java/org/apache/commons/lang3/BitField.java:280
↓ 30 callers
Method
validIndex
Validates that the index is within the bounds of the argument collection; otherwise throwing an exception. <pre>Validate.validIndex(myCollection, 2);
src/main/java/org/apache/commons/lang3/Validate.java:1088
← previous
next →
201–300 of 9,093, ranked by callers