Top Description Inners Fields Constructors Methods
org.assertj.core.error

public Class BasicErrorMessageFactory

extends Object
implements ErrorMessageFactory
Class Inheritance
All Implemented Interfaces
org.assertj.core.error.ErrorMessageFactory
Known Direct Subclasses
org.assertj.core.error.ClassModifierShouldBe, org.assertj.core.error.ConditionAndGroupGenericParameterTypeShouldBeTheSame, org.assertj.core.error.ElementsShouldBe, org.assertj.core.error.ElementsShouldBeAtLeast, org.assertj.core.error.ElementsShouldBeAtMost, org.assertj.core.error.ElementsShouldBeExactly, org.assertj.core.error.ElementsShouldHave, org.assertj.core.error.ElementsShouldHaveAtLeast, org.assertj.core.error.ElementsShouldHaveAtMost, org.assertj.core.error.ElementsShouldHaveExactly, org.assertj.core.error.ElementsShouldMatch, org.assertj.core.error.ElementsShouldNotBe, org.assertj.core.error.ElementsShouldNotHave, org.assertj.core.error.ShouldExist, org.assertj.core.error.ShouldHave, org.assertj.core.error.ShouldHaveAllNullFields, org.assertj.core.error.ShouldHaveAnnotations, org.assertj.core.error.ShouldHaveAtIndex, org.assertj.core.error.ShouldHaveAtLeastOneElementOfType, org.assertj.core.error.ShouldHaveBinaryContent, org.assertj.core.error.ShouldHaveCause, org.assertj.core.error.ShouldHaveCauseExactlyInstance, org.assertj.core.error.ShouldHaveCauseInstance, org.assertj.core.error.ShouldHaveCauseReference, org.assertj.core.error.ShouldHaveDateField, org.assertj.core.error.ShouldHaveDigest, org.assertj.core.error.ShouldHaveDimensions, org.assertj.core.error.ShouldHaveDuration, org.assertj.core.error.ShouldHaveExactlyTypes, org.assertj.core.error.ShouldBeEqualIgnoringHours, org.assertj.core.error.ShouldBeEqualIgnoringMinutes, org.assertj.core.error.ShouldBeEqualIgnoringNanos, org.assertj.core.error.ShouldBeEqualIgnoringNewLineDifferences, org.assertj.core.error.ShouldBeEqualIgnoringNewLines, org.assertj.core.error.ShouldBeEqualIgnoringSeconds, org.assertj.core.error.ShouldBeEqualIgnoringTimezone, org.assertj.core.error.ShouldBeEqualIgnoringWhitespace, org.assertj.core.error.ShouldBeEqualNormalizingPunctuationAndWhitespace, org.assertj.core.error.ShouldBeEqualNormalizingUnicode, org.assertj.core.error.ShouldBeEqualNormalizingWhitespace, org.assertj.core.error.ShouldBeEqualToIgnoringFields, org.assertj.core.error.ShouldBeEqualWithinOffset, org.assertj.core.error.ShouldBeEqualWithinPercentage, org.assertj.core.error.ShouldBeEqualWithTimePrecision, org.assertj.core.error.ShouldBeEven, org.assertj.core.error.ShouldBeExactlyInstanceOf, org.assertj.core.error.ShouldBeExecutable, org.assertj.core.error.ShouldBeExhausted, org.assertj.core.error.ShouldNotBeEqualWithinPercentage, org.assertj.core.error.ShouldNotBeExactlyInstanceOf, org.assertj.core.error.ShouldNotBeFinite, org.assertj.core.error.ShouldNotBeIn, org.assertj.core.error.ShouldNotBeInfinite, org.assertj.core.error.ShouldNotBeInstance, org.assertj.core.error.ShouldNotBeInstanceOfAny, org.assertj.core.error.ShouldNotBeNull, org.assertj.core.error.ShouldNotBeOfClassIn, org.assertj.core.error.ShouldNotBePrimitive, org.assertj.core.error.ShouldNotBeSame, org.assertj.core.error.ShouldNotContain, org.assertj.core.error.ShouldNotContainAnyWhitespaces, org.assertj.core.error.ShouldNotContainAtIndex, org.assertj.core.error.ShouldNotContainCharSequence, org.assertj.core.error.ShouldNotContainKey, org.assertj.core.error.ShouldNotContainKeys, org.assertj.core.error.ShouldNotContainNull, org.assertj.core.error.ShouldNotContainOnlyWhitespaces, org.assertj.core.error.ShouldNotContainPattern, org.assertj.core.error.ShouldNotContainSequence, org.assertj.core.error.ShouldNotContainSubsequence, org.assertj.core.error.ShouldNotContainValue, org.assertj.core.error.ShouldNotEndWith, org.assertj.core.error.ShouldNotEndWithIgnoringCase, org.assertj.core.error.ElementsShouldSatisfy, org.assertj.core.error.ShouldBeAfterOrEqualTo, org.assertj.core.error.ShouldBeEqualIgnoringCase, org.assertj.core.error.ShouldBeFalse, org.assertj.core.error.ShouldBeInThePast, org.assertj.core.error.ShouldBeUnmodifiable, org.assertj.core.error.ShouldContainOnlyDigits, org.assertj.core.error.ShouldEndWithPath, org.assertj.core.error.ShouldHaveExtension, org.assertj.core.error.ShouldHaveNoSuppressedExceptions, org.assertj.core.error.ShouldHaveSizeGreaterThan, org.assertj.core.error.ShouldNotBeEqualWithinOffset, org.assertj.core.error.ShouldNotEndWithWhitespaces, org.assertj.core.error.ShouldHaveOnlyElementsOfType, org.assertj.core.error.ShouldHavePackage, org.assertj.core.error.ShouldHaveParent, org.assertj.core.error.ShouldHavePeriod, org.assertj.core.error.ShouldHavePermittedSubclasses, org.assertj.core.error.ShouldHavePropertyOrField, org.assertj.core.error.ShouldHavePropertyOrFieldWithValue, org.assertj.core.error.ShouldHaveRecordComponents, org.assertj.core.error.ShouldHaveReference, org.assertj.core.error.ShouldHaveRootCause, org.assertj.core.error.ShouldHaveRootCauseExactlyInstance, org.assertj.core.error.ShouldHaveRootCauseInstance, org.assertj.core.error.ShouldHaveSameClass, org.assertj.core.error.ShouldHaveSameDimensionsAs, org.assertj.core.error.ShouldHaveSameFileSystemAs, org.assertj.core.error.ShouldHaveSameHashCode, org.assertj.core.error.ShouldHaveSameHourAs, org.assertj.core.error.ShouldHaveSameSizeAs, org.assertj.core.error.ShouldHaveSameTime, org.assertj.core.error.ShouldHaveScale, org.assertj.core.error.ShouldHaveSize, org.assertj.core.error.ShouldHaveSizeBetween, org.assertj.core.error.ShouldBeLess, org.assertj.core.error.ShouldBeLessOrEqual, org.assertj.core.error.ShouldBeLowerCase, org.assertj.core.error.ShouldBeMarked, org.assertj.core.error.ShouldBeMixedCase, org.assertj.core.error.ShouldBeNormalized, org.assertj.core.error.ShouldBeNullOrEmpty, org.assertj.core.error.ShouldBeNumeric, org.assertj.core.error.ShouldBeOdd, org.assertj.core.error.ShouldBeOfClassIn, org.assertj.core.error.ShouldBePeriod, org.assertj.core.error.ShouldBePrimitive, org.assertj.core.error.ShouldBePrintable, org.assertj.core.error.ShouldBeReadable, org.assertj.core.error.ShouldBeRecord, org.assertj.core.error.ShouldBeRegularFile, org.assertj.core.error.ShouldBeRelativePath, org.assertj.core.error.ShouldBeSame, org.assertj.core.error.ShouldBeSealed, org.assertj.core.error.ShouldBeSorted, org.assertj.core.error.ShouldBeSubsetOf, org.assertj.core.error.ShouldBeSubstring, org.assertj.core.error.ShouldBeSymbolicLink, org.assertj.core.error.ShouldBeToday, org.assertj.core.error.ShouldBeTrue, org.assertj.core.error.ShouldNotExist, org.assertj.core.error.ShouldNotHave, org.assertj.core.error.ShouldNotHaveAnyElementsOfTypes, org.assertj.core.error.ShouldNotHaveDuplicates, org.assertj.core.error.ShouldNotHaveSameClass, org.assertj.core.error.ShouldNotHaveSameHashCode, org.assertj.core.error.ShouldNotHaveThrown, org.assertj.core.error.ShouldNotHaveThrownExcept, org.assertj.core.error.ShouldNotHaveToString, org.assertj.core.error.ShouldNotMatch, org.assertj.core.error.ShouldNotMatchPattern, org.assertj.core.error.ShouldNotSatisfyPredicateRecursively, org.assertj.core.error.ShouldNotStartWith, org.assertj.core.error.ShouldNotStartWithIgnoringCase, org.assertj.core.error.ShouldNotStartWithWhitespaces, org.assertj.core.error.ShouldOnlyHaveElementsOfTypes, org.assertj.core.error.ShouldOnlyHaveFields, org.assertj.core.error.ShouldSatisfy, org.assertj.core.error.ShouldSatisfyOnlyOnce, org.assertj.core.error.ShouldStartWith, org.assertj.core.error.ShouldStartWithIgnoringCase, org.assertj.core.error.ShouldStartWithPath, org.assertj.core.error.SubarraysShouldHaveSameSize, org.assertj.core.error.ZippedElementsShouldSatisfy, org.assertj.core.error.ShouldBeAfterYear, org.assertj.core.error.ShouldBeAlphabetic, org.assertj.core.error.ShouldBeAlphanumeric, org.assertj.core.error.ShouldBeAnArray, org.assertj.core.error.ShouldBeAnnotation, org.assertj.core.error.ShouldBeASCII, org.assertj.core.error.ShouldBeAssignableFrom, org.assertj.core.error.ShouldBeAssignableTo, org.assertj.core.error.ShouldBeAtIndex, org.assertj.core.error.ShouldBeAtSameInstant, org.assertj.core.error.ShouldBeBase64, org.assertj.core.error.ShouldBeBefore, org.assertj.core.error.ShouldBeBeforeOrEqualTo, org.assertj.core.error.ShouldBeBeforeYear, org.assertj.core.error.ShouldBeBetween, org.assertj.core.error.ShouldBeBlank, org.assertj.core.error.ShouldBeCanonicalPath, org.assertj.core.error.ShouldBeCloseTo, org.assertj.core.error.ShouldBeCurrentYearMonth, org.assertj.core.error.ShouldBeDirectory, org.assertj.core.error.ShouldBeEmpty, org.assertj.core.error.ShouldBeEmptyDirectory, org.assertj.core.error.ShouldBeEqualByComparingFieldByFieldRecursively, org.assertj.core.error.ShouldBeEqualByComparingOnlyGivenFields, org.assertj.core.error.ShouldHaveSizeGreaterThanOrEqualTo, org.assertj.core.error.ShouldHaveSizeLessThan, org.assertj.core.error.ShouldHaveSizeLessThanOrEqualTo, org.assertj.core.error.ShouldHaveStamp, org.assertj.core.error.ShouldHaveSuperclass, org.assertj.core.error.ShouldHaveSuppressedException, org.assertj.core.error.ShouldHaveTime, org.assertj.core.error.ShouldHaveToString, org.assertj.core.error.ShouldHaveValue, org.assertj.core.error.ShouldMatch, org.assertj.core.error.ShouldMatchPattern, org.assertj.core.error.ShouldNotAccept, org.assertj.core.error.ShouldNotBe, org.assertj.core.error.ShouldNotBeBetween, org.assertj.core.error.ShouldNotBeBlank, org.assertj.core.error.ShouldNotBeEmpty, org.assertj.core.error.ShouldNotBeEqual, org.assertj.core.error.ShouldNotBeEqualComparingFieldByFieldRecursively, org.assertj.core.error.ShouldNotBeEqualIgnoringCase, org.assertj.core.error.ShouldNotBeEqualIgnoringWhitespace, org.assertj.core.error.ShouldNotBeEqualNormalizingWhitespace, org.assertj.core.error.ShouldBeFile, org.assertj.core.error.ShouldBeFinite, org.assertj.core.error.ShouldBeGreater, org.assertj.core.error.ShouldBeGreaterOrEqual, org.assertj.core.error.ShouldBeHexadecimal, org.assertj.core.error.ShouldBeIn, org.assertj.core.error.ShouldBeInfinite, org.assertj.core.error.ShouldBeInSameDay, org.assertj.core.error.ShouldBeInSameHour, org.assertj.core.error.ShouldBeInSameHourWindow, org.assertj.core.error.ShouldBeInSameMinute, org.assertj.core.error.ShouldBeInSameMinuteWindow, org.assertj.core.error.ShouldBeInSameMonth, org.assertj.core.error.ShouldBeInSameSecond, org.assertj.core.error.ShouldBeInSameSecondWindow, org.assertj.core.error.ShouldBeInSameYear, org.assertj.core.error.ShouldBeInstance, org.assertj.core.error.ShouldBeInstanceOfAny, org.assertj.core.error.ShouldBeInterface, org.assertj.core.error.ShouldBeInTheFuture, org.assertj.core.error.MatcherShouldMatch, org.assertj.core.error.NoElementsShouldMatch, org.assertj.core.error.NoElementsShouldSatisfy, org.assertj.core.error.OptionalDoubleShouldHaveValueCloseToOffset, org.assertj.core.error.OptionalDoubleShouldHaveValueCloseToPercentage, org.assertj.core.error.OptionalShouldBeEmpty, org.assertj.core.error.OptionalShouldBePresent, org.assertj.core.error.OptionalShouldContain, org.assertj.core.error.OptionalShouldContainInstanceOf, org.assertj.core.error.ShouldAccept, org.assertj.core.error.ShouldBe, org.assertj.core.error.ShouldBeAbsolutePath, org.assertj.core.error.ShouldBeAbstract, org.assertj.core.error.ShouldBeAfter, org.assertj.core.error.ShouldBeUpperCase, org.assertj.core.error.ShouldBeVisible, org.assertj.core.error.ShouldBeWritable, org.assertj.core.error.ShouldContain, org.assertj.core.error.ShouldContainAnyOf, org.assertj.core.error.ShouldContainAtIndex, org.assertj.core.error.ShouldContainCharSequence, org.assertj.core.error.ShouldContainCharSequenceOnlyOnce, org.assertj.core.error.ShouldContainEntries, org.assertj.core.error.ShouldContainEntry, org.assertj.core.error.ShouldContainExactly, org.assertj.core.error.ShouldContainExactlyInAnyOrder, org.assertj.core.error.ShouldContainKey, org.assertj.core.error.ShouldContainKeys, org.assertj.core.error.ShouldContainNull, org.assertj.core.error.ShouldContainOneOrMoreWhitespaces, org.assertj.core.error.ShouldContainOnly, org.assertj.core.error.ShouldHaveFields, org.assertj.core.error.ShouldHaveFileSystem, org.assertj.core.error.ShouldHaveLineCount, org.assertj.core.error.ShouldHaveMessage, org.assertj.core.error.ShouldHaveMessageFindingMatchRegex, org.assertj.core.error.ShouldHaveMessageMatchingRegex, org.assertj.core.error.ShouldHaveMethods, org.assertj.core.error.ShouldHaveName, org.assertj.core.error.ShouldHaveNext, org.assertj.core.error.ShouldHaveNoCause, org.assertj.core.error.ShouldHaveNoExtension, org.assertj.core.error.ShouldHaveNoFields, org.assertj.core.error.ShouldHaveNoNullFields, org.assertj.core.error.ShouldHaveNoPackage, org.assertj.core.error.ShouldHaveNoParent, org.assertj.core.error.ShouldHaveNoSuperclass, org.assertj.core.error.ShouldContainOnlyKeys, org.assertj.core.error.ShouldContainOnlyNulls, org.assertj.core.error.ShouldContainOnlyWhitespaces, org.assertj.core.error.ShouldContainPattern, org.assertj.core.error.ShouldContainRecursively, org.assertj.core.error.ShouldContainSequence, org.assertj.core.error.ShouldContainSequenceOfCharSequence, org.assertj.core.error.ShouldContainsOnlyOnce, org.assertj.core.error.ShouldContainSubsequence, org.assertj.core.error.ShouldContainSubsequenceOfCharSequence, org.assertj.core.error.ShouldContainValue, org.assertj.core.error.ShouldContainValues, org.assertj.core.error.ShouldEndWith, org.assertj.core.error.ShouldEndWithIgnoringCase, org.assertj.core.error.array2d.Array2dElementShouldBeDeepEqual, org.assertj.core.error.uri.ShouldBeEqualToWithSortedQueryParameters, org.assertj.core.error.uri.ShouldHaveAnchor, org.assertj.core.error.uri.ShouldHaveAuthority, org.assertj.core.error.uri.ShouldHaveFragment, org.assertj.core.error.uri.ShouldHaveHost, org.assertj.core.error.uri.ShouldHaveNoHost, org.assertj.core.error.uri.ShouldHaveParameter, org.assertj.core.error.uri.ShouldHavePath, org.assertj.core.error.uri.ShouldHavePort, org.assertj.core.error.uri.ShouldHaveProtocol, org.assertj.core.error.uri.ShouldHaveQuery, org.assertj.core.error.uri.ShouldHaveScheme, org.assertj.core.error.uri.ShouldHaveUserInfo, org.assertj.core.error.future.ShouldBeCancelled, org.assertj.core.error.future.ShouldBeCompleted, org.assertj.core.error.future.ShouldBeCompletedExceptionally, org.assertj.core.error.future.ShouldBeCompletedWithin, org.assertj.core.error.future.ShouldBeDone, org.assertj.core.error.future.ShouldHaveFailed, org.assertj.core.error.future.ShouldHaveFailedWithin, org.assertj.core.error.future.ShouldNotBeCancelled, org.assertj.core.error.future.ShouldNotBeCompleted, org.assertj.core.error.future.ShouldNotBeCompletedExceptionally, org.assertj.core.error.future.ShouldNotBeDone, org.assertj.core.error.future.ShouldNotHaveFailed, org.assertj.core.error.AbstractShouldHaveTextContent, org.assertj.core.error.ActualIsNotEmpty, org.assertj.core.error.AnyElementShouldMatch
Static Imports
java.lang.String.format, java.util.Objects.deepEquals, .Objects.requireNonNull, org.assertj.core.configuration.ConfigurationProvider.CONFIGURATION_PROVIDER, org.assertj.core.description.EmptyTextDescription.emptyDescription, org.assertj.core.util.Objects.HASH_CODE_PRIME, .Objects.hashCodeFor, .Strings.quote

A factory of error messages typically shown when an assertion fails.
Author
Alex Ruiz

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
BasicErrorMessageFactory.UnquotedString

To avoid quoted String in message format.

Field Summary

Modifier and TypeField and Description
protected final Object[]
protected final String
pack-priv MessageFormatter

Constructor Summary

AccessConstructor and Description
public
BasicErrorMessageFactory(String
the format string.
format
,
Object...
arguments referenced by the format specifiers in the format string.
arguments
)

Creates a new BasicErrorMessageFactory.

Method Summary

Modifier and TypeMethod and Description
public String
create(Description
the description of the failed assertion.
d
,
Representation
the representation used
representation
)

Implements org.assertj.core.error.ErrorMessageFactory.create.

Creates a new error message as a result of a failed assertion.
public String
create(Description
the description of the failed assertion.
d
)

Implements org.assertj.core.error.ErrorMessageFactory.create.

Creates a new error message as a result of a failed assertion with StandardRepresentation.
public String
create()

Implements org.assertj.core.error.ErrorMessageFactory.create.

Creates a new error message as a result of a failed assertion without description.
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
protected static CharSequence

Returns:

an unquoted string in message format.
unquotedString
(String
the string who will be unquoted.
string
)

Return a string who will be unquoted in message format (without '')

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

argumentsback to summary
protected final Object[] arguments
formatback to summary
protected final String format
formatterback to summary
pack-priv MessageFormatter formatter
Annotations
@VisibleForTesting

Constructor Detail

BasicErrorMessageFactoryback to summary
public BasicErrorMessageFactory(String format, Object... arguments)

Creates a new BasicErrorMessageFactory.

Parameters
format:String

the format string.

arguments:Object[]

arguments referenced by the format specifiers in the format string.

Method Detail

createback to summary
public String create(Description d, Representation representation)

Implements org.assertj.core.error.ErrorMessageFactory.create.

Doc from org.assertj.core.error.ErrorMessageFactory.create.

Creates a new error message as a result of a failed assertion.

Parameters
d:Description

the description of the failed assertion.

representation:Representation

the representation used

Returns:String

the created error message.

Annotations
@Override
createback to summary
public String create(Description d)

Implements org.assertj.core.error.ErrorMessageFactory.create.

Doc from org.assertj.core.error.ErrorMessageFactory.create.

Creates a new error message as a result of a failed assertion with StandardRepresentation.

Parameters
d:Description

the description of the failed assertion.

Returns:String

the created error message.

Annotations
@Override
createback to summary
public String create()

Implements org.assertj.core.error.ErrorMessageFactory.create.

Doc from org.assertj.core.error.ErrorMessageFactory.create.

Creates a new error message as a result of a failed assertion without description.

Returns:String

the created error message.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
unquotedStringback to summary
protected static CharSequence unquotedString(String string)

Return a string who will be unquoted in message format (without '')

Parameters
string:String

the string who will be unquoted.

Returns:CharSequence

an unquoted string in message format.

org.assertj.core.error back to summary

private Class BasicErrorMessageFactory.UnquotedString

extends Object
implements CharSequence
Class Inheritance
  • java.lang.Object
  • org.assertj.core.error.BasicErrorMessageFactory.UnquotedString
All Implemented Interfaces
java.lang.CharSequence

To avoid quoted String in message format.

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public char
charAt(int
the index of the char value to be returned
index
)

Implements java.lang.CharSequence.charAt.

Returns the char value at the specified index.
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
public int
length()

Implements java.lang.CharSequence.length.

Returns the length of this character sequence.
public CharSequence
subSequence(int
the start index, inclusive
start
,
int
the end index, exclusive
end
)

Implements java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence.
public String
toString()

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString.

Returns a string containing the characters in this sequence in the same order as this sequence.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

stringback to summary
private final String string

Constructor Detail

UnquotedStringback to summary
private UnquotedString(String string)

Method Detail

charAtback to summary
public char charAt(int index)

Implements java.lang.CharSequence.charAt.

Doc from java.lang.CharSequence.charAt.

Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Parameters
index:int

the index of the char value to be returned

Returns:char

the specified char value

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
lengthback to summary
public int length()

Implements java.lang.CharSequence.length.

Doc from java.lang.CharSequence.length.

Returns the length of this character sequence. The length is the number of 16-bit chars in the sequence.

Returns:int

the number of chars in this sequence

Annotations
@Override
subSequenceback to summary
public CharSequence subSequence(int start, int end)

Implements java.lang.CharSequence.subSequence.

Doc from java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Parameters
start:int

the start index, inclusive

end:int

the end index, exclusive

Returns:CharSequence

the specified subsequence

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString.

Doc from java.lang.CharSequence.toString.

Returns a string containing the characters in this sequence in the same order as this sequence. The length of the string will be the length of this sequence.

Returns:String

a string consisting of exactly this sequence of characters

Annotations
@Override