Class BasicErrorMessageFactory

java.lang.Object
org.fest.assertions.error.BasicErrorMessageFactory
All Implemented Interfaces:
ErrorMessageFactory
Direct Known Subclasses:
AbstractShouldHaveTextContent, ConditionAndGroupGenericParameterTypeShouldBeTheSame, ElementsShouldBe, ElementsShouldBeAtLeast, ElementsShouldBeAtMost, ElementsShouldBeExactly, ElementsShouldHave, ElementsShouldHaveAtLeast, ElementsShouldHaveAtMost, ElementsShouldHaveExactly, ElementsShouldNotBe, ElementsShouldNotBeAtLeast, ElementsShouldNotBeAtMost, ElementsShouldNotBeExactly, ElementsShouldNotHave, ElementsShouldNotHaveAtLeast, ElementsShouldNotHaveAtMost, ElementsShouldNotHaveExactly, ShouldBe, ShouldBeAbsolutePath, ShouldBeAfter, ShouldBeAfterOrEqualsTo, ShouldBeAtIndex, ShouldBeBefore, ShouldBeBeforeOrEqualsTo, ShouldBeBetween, ShouldBeCloseTo, ShouldBeDirectory, ShouldBeEmpty, ShouldBeEqualIgnoringCase, ShouldBeEqualImages, ShouldBeEqualWithinOffset, ShouldBeExactlyInstanceOf, ShouldBeExecutable, ShouldBeFile, ShouldBeGreater, ShouldBeGreaterOrEqual, ShouldBeIn, ShouldBeInSameDay, ShouldBeInSameHour, ShouldBeInSameMillisecond, ShouldBeInSameMinute, ShouldBeInSameMonth, ShouldBeInSameSecond, ShouldBeInSameYear, ShouldBeInstance, ShouldBeInstanceOfAny, ShouldBeInTheFuture, ShouldBeInThePast, ShouldBeLenientEqualByAccepting, ShouldBeLenientEqualByIgnoring, ShouldBeLess, ShouldBeLessOrEqual, ShouldBeLowerCase, ShouldBeNullOrEmpty, ShouldBeOfClassIn, ShouldBeReadable, ShouldBeRelativePath, ShouldBeSame, ShouldBeSorted, ShouldBeSubsetOf, ShouldBeToday, ShouldBeUpperCase, ShouldBeWithin, ShouldBeWritable, ShouldContain, ShouldContainAtIndex, ShouldContainExactly, ShouldContainKey, ShouldContainNull, ShouldContainOnly, ShouldContainSequence, ShouldContainString, ShouldContainStringOnlyOnce, ShouldContainValue, ShouldEndWith, ShouldExist, ShouldHave, ShouldHaveAtIndex, ShouldHaveBinaryContent, ShouldHaveMessage, ShouldHaveNoCause, ShouldHaveSameClass, ShouldHaveSameSizeAs, ShouldHaveSize, ShouldHaveTime, ShouldMatchPattern, ShouldNotBe, ShouldNotBeBetween, ShouldNotBeEqual, ShouldNotBeExactlyInstanceOf, ShouldNotBeIn, ShouldNotBeInstance, ShouldNotBeInstanceOfAny, ShouldNotBeOfClassIn, ShouldNotBeSame, ShouldNotContain, ShouldNotContainAtIndex, ShouldNotContainKey, ShouldNotContainNull, ShouldNotContainString, ShouldNotContainValue, ShouldNotExist, ShouldNotHave, ShouldNotHaveDuplicates, ShouldNotHaveSameClass, ShouldNotMatchPattern, ShouldStartWith

public class BasicErrorMessageFactory extends Object implements ErrorMessageFactory
A factory of error messages typically shown when an assertion fails.
Author:
Alex Ruiz
  • Field Details

    • format

      protected final String format
    • arguments

      protected final Object[] arguments
  • Constructor Details

    • BasicErrorMessageFactory

      public BasicErrorMessageFactory(String format, Object... arguments)
      Parameters:
      format - the format string.
      arguments - arguments referenced by the format specifiers in the format string.
  • Method Details

    • create

      public String create(Description d)
      Creates a new error message as a result of a failed assertion.
      Specified by:
      create in interface ErrorMessageFactory
      Parameters:
      d - the description of the failed assertion.
      Returns:
      the created error message.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object