Example #1
0
  public boolean isIdentical(Object object) {
    if (this == object) {
      return true;
    }

    if (!(object instanceof JRBaseStyle)) {
      return false;
    }

    JRBaseStyle style = (JRBaseStyle) object;

    return ObjectUtils.equalsIdentity(parentStyle, style.parentStyle)
        && identicalStyle(style)
        && ObjectUtils.identical(conditionalStyles, style.conditionalStyles);
  }
Example #2
0
  public int getHashCode() {
    ObjectUtils.HashCode hash = ObjectUtils.hash();
    hash.addIdentity(parentStyle);
    addStyleHash(hash);

    // maybe adding conditional style to the hash is not worth it
    // as the remaining attributes provide good enough hash information
    hash.addIdentical(conditionalStyles);

    return hash.getHashCode();
  }
Example #3
0
 protected boolean identicalStyle(JRBaseStyle style) {
   return ObjectUtils.equals(name, style.name)
       && ObjectUtils.equals(isDefault, style.isDefault)
       && ObjectUtils.equals(modeValue, style.modeValue)
       && ObjectUtils.equals(forecolor, style.forecolor)
       && ObjectUtils.equals(backcolor, style.backcolor)
       && ObjectUtils.identical(linePen, style.linePen)
       && ObjectUtils.equals(fillValue, style.fillValue)
       && ObjectUtils.equals(radius, style.radius)
       && ObjectUtils.equals(scaleImageValue, style.scaleImageValue)
       && ObjectUtils.equals(horizontalAlignmentValue, style.horizontalAlignmentValue)
       && ObjectUtils.equals(verticalAlignmentValue, style.verticalAlignmentValue)
       && ObjectUtils.identical(lineBox, style.lineBox)
       && ObjectUtils.identical(paragraph, style.paragraph)
       && ObjectUtils.equals(fontName, style.fontName)
       && ObjectUtils.equals(isBold, style.isBold)
       && ObjectUtils.equals(isItalic, style.isItalic)
       && ObjectUtils.equals(isUnderline, style.isUnderline)
       && ObjectUtils.equals(isStrikeThrough, style.isStrikeThrough)
       && ObjectUtils.equals(fontSize, style.fontSize)
       && ObjectUtils.equals(pdfFontName, style.pdfFontName)
       && ObjectUtils.equals(pdfEncoding, style.pdfEncoding)
       && ObjectUtils.equals(isPdfEmbedded, style.isPdfEmbedded)
       && ObjectUtils.equals(rotationValue, style.rotationValue)
       && ObjectUtils.equals(markup, style.markup)
       && ObjectUtils.equals(pattern, style.pattern)
       && ObjectUtils.equals(isBlankWhenNull, style.isBlankWhenNull);
 }