Top Fields Constructors Methods
org.assertj.core.internal

public Class Strings

extends Object
Class Inheritance
Static Imports
java.lang.Character.isDigit, .Character.isWhitespace, .String.format, java.util.Arrays.stream, .Locale.ROOT, .Objects.requireNonNull, java.util.function.Function.identity, java.util.stream.Collectors.counting, .Collectors.groupingBy, .Collectors.toCollection, .Collectors.toMap, org.assertj.core.error.ShouldBeBase64.shouldBeBase64, .ShouldBeEmpty.shouldBeEmpty, .ShouldBeEqual.shouldBeEqual, .ShouldBeEqualIgnoringCase.shouldBeEqual, .ShouldBeEqualIgnoringNewLineDifferences.shouldBeEqualIgnoringNewLineDifferences, .ShouldBeEqualIgnoringNewLines.shouldBeEqualIgnoringNewLines, .ShouldBeEqualIgnoringWhitespace.shouldBeEqualIgnoringWhitespace, .ShouldBeEqualNormalizingPunctuationAndWhitespace.shouldBeEqualNormalizingPunctuationAndWhitespace, .ShouldBeEqualNormalizingUnicode.shouldBeEqualNormalizingUnicode, .ShouldBeEqualNormalizingWhitespace.shouldBeEqualNormalizingWhitespace, .ShouldBeLowerCase.shouldBeLowerCase, .ShouldBeMixedCase.shouldBeMixedCase, .ShouldBeNullOrEmpty.shouldBeNullOrEmpty, .ShouldBeSubstring.shouldBeSubstring, .ShouldBeUpperCase.shouldBeUpperCase, .ShouldContainAnyOf.shouldContainAnyOf, .ShouldContainCharSequence.containsIgnoringNewLines, .ShouldContainCharSequence.shouldContain, .ShouldContainCharSequence.shouldContainIgnoringCase, .ShouldContainCharSequenceOnlyOnce.shouldContainOnlyOnce, .ShouldContainOnlyDigits.shouldContainOnlyDigits, .ShouldContainPattern.shouldContainPattern, .ShouldContainSequenceOfCharSequence.shouldContainSequence, .ShouldContainSubsequenceOfCharSequence.shouldContainSubsequence, .ShouldEndWith.shouldEndWith, .ShouldEndWithIgnoringCase.shouldEndWithIgnoringCase, .ShouldHaveSizeGreaterThan.shouldHaveSizeGreaterThan, .ShouldHaveSizeGreaterThanOrEqualTo.shouldHaveSizeGreaterThanOrEqualTo, .ShouldHaveSizeLessThan.shouldHaveSizeLessThan, .ShouldHaveSizeLessThanOrEqualTo.shouldHaveSizeLessThanOrEqualTo, .ShouldMatchPattern.shouldMatch, .ShouldNotBeEmpty.shouldNotBeEmpty, .ShouldNotBeEqualIgnoringCase.shouldNotBeEqualIgnoringCase, .ShouldNotBeEqualIgnoringWhitespace.shouldNotBeEqualIgnoringWhitespace, .ShouldNotBeEqualNormalizingWhitespace.shouldNotBeEqualNormalizingWhitespace, .ShouldNotContainCharSequence.shouldNotContain, .ShouldNotContainCharSequence.shouldNotContainIgnoringCase, .ShouldNotContainPattern.shouldNotContainPattern, .ShouldNotEndWith.shouldNotEndWith, .ShouldNotEndWithIgnoringCase.shouldNotEndWithIgnoringCase, .ShouldNotMatchPattern.shouldNotMatch, .ShouldNotStartWith.shouldNotStartWith, .ShouldNotStartWithIgnoringCase.shouldNotStartWithIgnoringCase, .ShouldStartWith.shouldStartWith, .ShouldStartWithIgnoringCase.shouldStartWithIgnoringCase, org.assertj.core.internal.Arrays.assertIsArray, .CommonErrors.arrayOfValuesToLookForIsEmpty, .CommonErrors.arrayOfValuesToLookForIsNull, .CommonValidations.checkLineCounts, .CommonValidations.checkOtherIsNotNull, .CommonValidations.checkSameSizes, .CommonValidations.checkSizeBetween, .CommonValidations.checkSizes, .CommonValidations.hasSameSizeAsCheck, org.assertj.core.util.xml.XmlStringPrettyFormatter.xmlPrettyFormat

Authors
Alex Ruiz, Joel Costigliola, Nicolas François, Mikhail Mazursky, Michal Kordas

Field Summary

Modifier and TypeField and Description
private final ComparisonStrategy
private static final String
pack-priv Failures
private static final Strings
private static final Set<Character>
private static final String

Constructor Summary

AccessConstructor and Description
pack-priv
public
Strings(ComparisonStrategy comparisonStrategy)

Method Summary

Modifier and TypeMethod and Description
private static boolean
private boolean
public void
public void
public void
public void
assertContainsIgnoringNewLines(final AssertionInfo info, final CharSequence actual, final CharSequence... values)

public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
assertHasLineCount(AssertionInfo info, CharSequence actual, int expectedLineCount)

public void
public void
public void
public void
assertHasSize(AssertionInfo info, CharSequence actual, int expectedSize)

public void
assertHasSizeBetween(AssertionInfo info, CharSequence actual, int lowerBoundary, int higherBoundary)

public void
assertHasSizeGreaterThan(AssertionInfo info, CharSequence actual, int expectedMinSizeExcluded)

public void
assertHasSizeGreaterThanOrEqualTo(AssertionInfo info, CharSequence actual, int expectedMinSizeIncluded)

public void
assertHasSizeLessThan(AssertionInfo info, CharSequence actual, int expectedMaxSizeExcluded)

public void
assertHasSizeLessThanOrEqualTo(AssertionInfo info, CharSequence actual, int expectedMaxSizeIncluded)

public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
private static void
public void
public void
public void
public void
public void
private static void
private static void
private static void
private static void
private static void
private void
private static void
private boolean
private int
countOccurrences(CharSequence sequenceToSearch, CharSequence actual)

public static void
private boolean
endsWith(CharSequence actual, CharSequence suffix, boolean ignoreCase)

private static void
private static void
public Comparator<?>
private Map<CharSequence, Integer>

Returns:

A map where the key represents the missing subsequence and the value represents the number of times it appears in 'actual'.
getNotFoundSubsequence
(CharSequence
The actual CharSequence being checked.
actual
,
CharSequence[]
The expected subsequence to be found in the actual CharSequence.
subsequence
)

Computes and returns a map of subsequence elements that were not found (or not found enough times) in actual.

private void
handleNotFound(AssertionInfo
Assertion metadata.
info
,
CharSequence
The actual CharSequence being checked.
actual
,
CharSequence[]
The expected subsequence to be found in the actual CharSequence.
subsequence
,
Map<CharSequence, Integer>
A map containing subsequences that were not found (or not found enough times) and their respective counts.
notFound
)

Handles the scenario where certain subsequences were not found in the actual CharSequence.

private static boolean
private int
indexOf(String string, CharSequence toFind)

public static Strings
private boolean
private boolean
private static String
private static String
private static String
private static NullPointerException
public static String
private static String
private String
removeUpTo(String string, CharSequence toRemove)

private boolean
startsWith(CharSequence actual, CharSequence prefix, boolean ignoreCase)

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait