Text implements ParagraphElement { @Override public final int hashCode() { return this.paragraphs == null ? 0 : this.paragraphs.hashCode(); } Text(final List<Paragraph> paragraphs); static TextBuilder builder(); static Text content(final String text); static Text styledContent(final String text, final TextStyle ts); @Override void addEmbeddedStylesFromCell(final StylesContainer stylesContainer); @Override void addEmbeddedStylesFromFooterHeader(final StylesContainer stylesContainer); @Override void appendXMLContent(final XMLUtil util, final Appendable appendable); boolean isEmpty(); @Override boolean equals(final Object o); @Override final int hashCode(); static final String TEXT_DATE; static final String TEXT_FILE_NAME; static final String TEXT_PAGE_COUNT; static final String TEXT_PAGE_NUMBER; static final String TEXT_SHEET_NAME; static final String TEXT_TIME; }
@Test public void testHashCode() { final Text text1 = Text.builder().parContent("text").link("url", "#url") .parStyledContent("text2", null).span("span").build(); final Text text2 = Text.builder().par().styledSpan("text", null).link("url", "#url").par() .span("text2").span("span").build(); Assert.assertEquals(-633306896, text1.hashCode()); Assert.assertEquals(-633306896, text2.hashCode()); }