Package org.assertj.core.error
Class BasicErrorMessageFactory
- java.lang.Object
-
- org.assertj.core.error.BasicErrorMessageFactory
-
- All Implemented Interfaces:
ErrorMessageFactory
- Direct Known Subclasses:
AbstractShouldHaveTextContent
,AnyElementShouldMatch
,Array2dElementShouldBeDeepEqual
,ClassModifierShouldBe
,ConditionAndGroupGenericParameterTypeShouldBeTheSame
,ElementsShouldBe
,ElementsShouldBeAtLeast
,ElementsShouldBeAtMost
,ElementsShouldBeExactly
,ElementsShouldHave
,ElementsShouldHaveAtLeast
,ElementsShouldHaveAtMost
,ElementsShouldHaveExactly
,ElementsShouldMatch
,ElementsShouldNotBe
,ElementsShouldNotHave
,ElementsShouldSatisfy
,NoElementsShouldMatch
,NoElementsShouldSatisfy
,OptionalDoubleShouldHaveValueCloseToOffset
,OptionalDoubleShouldHaveValueCloseToPercentage
,OptionalShouldBeEmpty
,OptionalShouldBePresent
,OptionalShouldContain
,OptionalShouldContainInstanceOf
,ShouldAccept
,ShouldBe
,ShouldBeAbsolutePath
,ShouldBeAbstract
,ShouldBeAfter
,ShouldBeAfterOrEqualTo
,ShouldBeAfterYear
,ShouldBeAnArray
,ShouldBeAnnotation
,ShouldBeAssignableFrom
,ShouldBeAtIndex
,ShouldBeAtSameInstant
,ShouldBeBase64
,ShouldBeBefore
,ShouldBeBeforeOrEqualTo
,ShouldBeBeforeYear
,ShouldBeBetween
,ShouldBeBlank
,ShouldBeCancelled
,ShouldBeCanonicalPath
,ShouldBeCloseTo
,ShouldBeCompleted
,ShouldBeCompletedExceptionally
,ShouldBeCompletedWithin
,ShouldBeDirectory
,ShouldBeDone
,ShouldBeEmpty
,ShouldBeEmptyDirectory
,ShouldBeEqualByComparingFieldByFieldRecursively
,ShouldBeEqualByComparingOnlyGivenFields
,ShouldBeEqualIgnoringCase
,ShouldBeEqualIgnoringHours
,ShouldBeEqualIgnoringMinutes
,ShouldBeEqualIgnoringNanos
,ShouldBeEqualIgnoringNewLineDifferences
,ShouldBeEqualIgnoringNewLines
,ShouldBeEqualIgnoringSeconds
,ShouldBeEqualIgnoringTimezone
,ShouldBeEqualIgnoringWhitespace
,ShouldBeEqualNormalizingPunctuationAndWhitespace
,ShouldBeEqualNormalizingWhitespace
,ShouldBeEqualToIgnoringFields
,ShouldBeEqualToWithSortedQueryParameters
,ShouldBeEqualWithinOffset
,ShouldBeEqualWithinPercentage
,ShouldBeEqualWithTimePrecision
,ShouldBeEven
,ShouldBeExactlyInstanceOf
,ShouldBeExecutable
,ShouldBeExhausted
,ShouldBeFalse
,ShouldBeFile
,ShouldBeGreater
,ShouldBeGreaterOrEqual
,ShouldBeIn
,ShouldBeInSameDay
,ShouldBeInSameHour
,ShouldBeInSameHourWindow
,ShouldBeInSameMinute
,ShouldBeInSameMinuteWindow
,ShouldBeInSameMonth
,ShouldBeInSameSecond
,ShouldBeInSameSecondWindow
,ShouldBeInSameYear
,ShouldBeInstance
,ShouldBeInstanceOfAny
,ShouldBeInterface
,ShouldBeInTheFuture
,ShouldBeInThePast
,ShouldBeLess
,ShouldBeLessOrEqual
,ShouldBeLowerCase
,ShouldBeMarked
,ShouldBeNormalized
,ShouldBeNullOrEmpty
,ShouldBeOdd
,ShouldBeOfClassIn
,ShouldBePeriod
,ShouldBeReadable
,ShouldBeRegularFile
,ShouldBeRelativePath
,ShouldBeSame
,ShouldBeSorted
,ShouldBeSubsetOf
,ShouldBeSubstring
,ShouldBeSymbolicLink
,ShouldBeToday
,ShouldBeTrue
,ShouldBeUpperCase
,ShouldBeWritable
,ShouldContain
,ShouldContainAnyOf
,ShouldContainAtIndex
,ShouldContainCharSequence
,ShouldContainCharSequenceOnlyOnce
,ShouldContainEntry
,ShouldContainExactly
,ShouldContainExactlyInAnyOrder
,ShouldContainKey
,ShouldContainKeys
,ShouldContainNull
,ShouldContainOneOrMoreWhitespaces
,ShouldContainOnly
,ShouldContainOnlyDigits
,ShouldContainOnlyKeys
,ShouldContainOnlyNulls
,ShouldContainOnlyWhitespaces
,ShouldContainPattern
,ShouldContainRecursively
,ShouldContainSequence
,ShouldContainSequenceOfCharSequence
,ShouldContainsOnlyOnce
,ShouldContainSubsequence
,ShouldContainSubsequenceOfCharSequence
,ShouldContainValue
,ShouldContainValues
,ShouldEndWith
,ShouldEndWithPath
,ShouldExist
,ShouldHave
,ShouldHaveAllNullFields
,ShouldHaveAnchor
,ShouldHaveAnnotations
,ShouldHaveAtIndex
,ShouldHaveAtLeastOneElementOfType
,ShouldHaveAuthority
,ShouldHaveBinaryContent
,ShouldHaveCause
,ShouldHaveCauseExactlyInstance
,ShouldHaveCauseInstance
,ShouldHaveCauseReference
,ShouldHaveDateField
,ShouldHaveDigest
,ShouldHaveDimensions
,ShouldHaveDuration
,ShouldHaveExtension
,ShouldHaveFailed
,ShouldHaveFailedWithin
,ShouldHaveFields
,ShouldHaveFragment
,ShouldHaveHost
,ShouldHaveLineCount
,ShouldHaveMessage
,ShouldHaveMessageFindingMatchRegex
,ShouldHaveMessageMatchingRegex
,ShouldHaveMethods
,ShouldHaveName
,ShouldHaveNext
,ShouldHaveNoCause
,ShouldHaveNoFields
,ShouldHaveNoNullFields
,ShouldHaveNoParent
,ShouldHaveNoSuperclass
,ShouldHaveNoSuppressedExceptions
,ShouldHaveOnlyElementsOfType
,ShouldHavePackage
,ShouldHaveParameter
,ShouldHaveParent
,ShouldHavePath
,ShouldHavePeriod
,ShouldHavePort
,ShouldHavePropertyOrField
,ShouldHavePropertyOrFieldWithValue
,ShouldHaveProtocol
,ShouldHaveQuery
,ShouldHaveReference
,ShouldHaveRootCause
,ShouldHaveRootCauseExactlyInstance
,ShouldHaveRootCauseInstance
,ShouldHaveSameClass
,ShouldHaveSameDimensionsAs
,ShouldHaveSameHashCode
,ShouldHaveSameHourAs
,ShouldHaveSameSizeAs
,ShouldHaveSameTime
,ShouldHaveScheme
,ShouldHaveSize
,ShouldHaveSizeBetween
,ShouldHaveSizeGreaterThan
,ShouldHaveSizeGreaterThanOrEqualTo
,ShouldHaveSizeLessThan
,ShouldHaveSizeLessThanOrEqualTo
,ShouldHaveStamp
,ShouldHaveSuperclass
,ShouldHaveSuppressedException
,ShouldHaveTime
,ShouldHaveToString
,ShouldHaveUserInfo
,ShouldHaveValue
,ShouldMatch
,ShouldMatchPattern
,ShouldNotAccept
,ShouldNotBe
,ShouldNotBeBetween
,ShouldNotBeBlank
,ShouldNotBeCancelled
,ShouldNotBeCompleted
,ShouldNotBeCompletedExceptionally
,ShouldNotBeDone
,ShouldNotBeEmpty
,ShouldNotBeEqual
,ShouldNotBeEqualComparingFieldByFieldRecursively
,ShouldNotBeEqualIgnoringCase
,ShouldNotBeEqualIgnoringWhitespace
,ShouldNotBeEqualNormalizingWhitespace
,ShouldNotBeEqualWithinOffset
,ShouldNotBeEqualWithinPercentage
,ShouldNotBeExactlyInstanceOf
,ShouldNotBeIn
,ShouldNotBeInstance
,ShouldNotBeInstanceOfAny
,ShouldNotBeNull
,ShouldNotBeOfClassIn
,ShouldNotBeSame
,ShouldNotContain
,ShouldNotContainAnyWhitespaces
,ShouldNotContainAtIndex
,ShouldNotContainCharSequence
,ShouldNotContainKey
,ShouldNotContainKeys
,ShouldNotContainNull
,ShouldNotContainOnlyWhitespaces
,ShouldNotContainPattern
,ShouldNotContainSequence
,ShouldNotContainSubsequence
,ShouldNotContainValue
,ShouldNotEndWith
,ShouldNotExist
,ShouldNotHave
,ShouldNotHaveAnyElementsOfTypes
,ShouldNotHaveDuplicates
,ShouldNotHaveFailed
,ShouldNotHaveSameClass
,ShouldNotHaveThrown
,ShouldNotMatch
,ShouldNotMatchPattern
,ShouldNotStartWith
,ShouldOnlyHaveElementsOfTypes
,ShouldOnlyHaveFields
,ShouldSatisfy
,ShouldStartWith
,ShouldStartWithPath
,SubarraysShouldHaveSameSize
,ZippedElementsShouldSatisfy
public class BasicErrorMessageFactory extends Object implements ErrorMessageFactory
A factory of error messages typically shown when an assertion fails.- Author:
- Alex Ruiz
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
BasicErrorMessageFactory.UnquotedString
To avoid quoted String in message format.
-
Constructor Summary
Constructors Constructor Description BasicErrorMessageFactory(String format, Object... arguments)
Creates a new
.BasicErrorMessageFactory
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
create()
Creates a new error message as a result of a failed assertion without description.String
create(Description d)
Creates a new error message as a result of a failed assertion withStandardRepresentation
.String
create(Description d, Representation representation)
Creates a new error message as a result of a failed assertion.boolean
equals(Object obj)
int
hashCode()
String
toString()
protected static CharSequence
unquotedString(String string)
Return a string who will be unquoted in message format (without '')
-
-
-
Field Detail
-
format
protected final String format
-
arguments
protected final Object[] arguments
-
formatter
MessageFormatter formatter
-
-
Constructor Detail
-
BasicErrorMessageFactory
public BasicErrorMessageFactory(String format, Object... arguments)
Creates a new
.BasicErrorMessageFactory
- Parameters:
format
- the format string.arguments
- arguments referenced by the format specifiers in the format string.
-
-
Method Detail
-
create
public String create(Description d, Representation representation)
Creates a new error message as a result of a failed assertion.- Specified by:
create
in interfaceErrorMessageFactory
- Parameters:
d
- the description of the failed assertion.representation
- the representation used- Returns:
- the created error message.
-
create
public String create(Description d)
Creates a new error message as a result of a failed assertion withStandardRepresentation
.- Specified by:
create
in interfaceErrorMessageFactory
- Parameters:
d
- the description of the failed assertion.- Returns:
- the created error message.
-
create
public String create()
Creates a new error message as a result of a failed assertion without description.- Specified by:
create
in interfaceErrorMessageFactory
- Returns:
- the created error message.
-
unquotedString
protected static CharSequence unquotedString(String string)
Return a string who will be unquoted in message format (without '')- Parameters:
string
- the string who will be unquoted.- Returns:
- an unquoted string in message format.
-
-