Package org.hamcrest

Class BaseDescription

    • Constructor Detail

      • BaseDescription

        public BaseDescription()
    • Method Detail

      • appendText

        public Description appendText​(java.lang.String text)
        Description copied from interface: Description
        Appends some plain text to the description.
        Specified by:
        appendText in interface Description
        Parameters:
        text - the text to append.
        Returns:
        the update description when displaying the matcher error.
      • appendValue

        public Description appendValue​(java.lang.Object value)
        Description copied from interface: Description
        Appends an arbitrary value to the description.
        Specified by:
        appendValue in interface Description
        Parameters:
        value - the object to append.
        Returns:
        the update description when displaying the matcher error.
      • appendValueList

        @SafeVarargs
        public final <T> Description appendValueList​(java.lang.String start,
                                                     java.lang.String separator,
                                                     java.lang.String end,
                                                     T... values)
        Description copied from interface: Description
        Appends a list of values to the description.
        Specified by:
        appendValueList in interface Description
        Type Parameters:
        T - the description type.
        Parameters:
        start - the prefix.
        separator - the separator.
        end - the suffix.
        values - the values to append.
        Returns:
        the update description when displaying the matcher error.
      • appendValueList

        public <T> Description appendValueList​(java.lang.String start,
                                               java.lang.String separator,
                                               java.lang.String end,
                                               java.lang.Iterable<T> values)
        Description copied from interface: Description
        Appends a list of values to the description.
        Specified by:
        appendValueList in interface Description
        Type Parameters:
        T - the description type.
        Parameters:
        start - the prefix.
        separator - the separator.
        end - the suffix.
        values - the values to append.
        Returns:
        the update description when displaying the matcher error.
      • appendList

        public Description appendList​(java.lang.String start,
                                      java.lang.String separator,
                                      java.lang.String end,
                                      java.lang.Iterable<? extends SelfDescribing> values)
        Description copied from interface: Description
        Appends a list of SelfDescribing objects to the description.
        Specified by:
        appendList in interface Description
        Parameters:
        start - the prefix.
        separator - the separator.
        end - the suffix.
        values - the values to append.
        Returns:
        the update description when displaying the matcher error.
      • append

        protected void append​(java.lang.String str)
        Append the String str to the description. The default implementation passes every character to append(char). Override in subclasses to provide an efficient implementation.
        Parameters:
        str - the string to append.
      • append

        protected abstract void append​(char c)
        Append the char c to the description.
        Parameters:
        c - the char to append.