Verbatim.java

  1. package org.jbehave.core.model;

  2. import org.apache.commons.lang3.builder.ToStringBuilder;
  3. import org.apache.commons.lang3.builder.ToStringStyle;

  4. /**
  5.  * Represents a text content that needs to rendered verbatim, ie as it is laid out in the original textual
  6.  * representation.
  7.  * <pre>
  8.  *     Some textual value
  9.  *   where we preserve spaces
  10.  *      and new lines
  11.  * </pre>
  12.  */
  13. public class Verbatim {

  14.     final String content;

  15.     public Verbatim(String content) {
  16.         this.content = content;
  17.     }

  18.     public String getContent() {
  19.         return content;
  20.     }

  21.     @Override
  22.     public String toString() {
  23.         return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
  24.     }

  25. }