@Test public void testDifferentSourceDifferentSourceId() throws Exception { MutableScreenOverlayAttributesImpl c1 = new MutableScreenOverlayAttributesImpl(new URL("http: MutableScreenOverlayAttributesImpl c2 = new MutableScreenOverlayAttributesImpl("<html><body>Some content1</body></html>"); assertFalse(c1.getSourceId().equalsIgnoreCase(c2.getSourceId())); }
@Override public String getSourceId() { if (sourceId == null) { CRC32 checksum = new CRC32(); if (sourceUrl != null) { checksum.update((sourceUrl.toExternalForm()).getBytes()); } else { checksum.update(sourceHtml.getBytes()); } sourceId = ID_PREFIX + checksum.getValue(); } return sourceId; }
MutableScreenOverlayAttributesImpl implements ScreenOverlayAttributes { @Override public String getSourceId() { if (sourceId == null) { CRC32 checksum = new CRC32(); if (sourceUrl != null) { checksum.update((sourceUrl.toExternalForm()).getBytes()); } else { checksum.update(sourceHtml.getBytes()); } sourceId = ID_PREFIX + checksum.getValue(); } return sourceId; } }
MutableScreenOverlayAttributesImpl implements ScreenOverlayAttributes { @Override public String getSourceId() { if (sourceId == null) { CRC32 checksum = new CRC32(); if (sourceUrl != null) { checksum.update((sourceUrl.toExternalForm()).getBytes()); } else { checksum.update(sourceHtml.getBytes()); } sourceId = ID_PREFIX + checksum.getValue(); } return sourceId; } MutableScreenOverlayAttributesImpl();  MutableScreenOverlayAttributesImpl(URL sourceUrl);  MutableScreenOverlayAttributesImpl(String sourceHtml);  MutableScreenOverlayAttributesImpl(AVList params); }
MutableScreenOverlayAttributesImpl implements ScreenOverlayAttributes { @Override public String getSourceId() { if (sourceId == null) { CRC32 checksum = new CRC32(); if (sourceUrl != null) { checksum.update((sourceUrl.toExternalForm()).getBytes()); } else { checksum.update(sourceHtml.getBytes()); } sourceId = ID_PREFIX + checksum.getValue(); } return sourceId; } MutableScreenOverlayAttributesImpl();  MutableScreenOverlayAttributesImpl(URL sourceUrl);  MutableScreenOverlayAttributesImpl(String sourceHtml);  MutableScreenOverlayAttributesImpl(AVList params); @Override URL getSourceUrl(); @Override String getSourceHtml(); @Override String getSourceId(); @Override boolean isSourceHtml(); @Override boolean isSourceImage(); @Override ScreenOverlayPosition getPosition(); void setPosition(ScreenOverlayPosition position); @Override LengthExpression getMinHeight(); void setMinHeight(String expression); void setMinHeight(LengthExpression minHeight); @Override LengthExpression getMaxHeight(); void setMaxHeight(String expression); void setMaxHeight(LengthExpression maxHeight); @Override float getHeight(float screenHeight); @Override LengthExpression getMinWidth(); void setMinWidth(String expression); void setMinWidth(LengthExpression minWidth); @Override LengthExpression getMaxWidth(); void setMaxWidth(String expression); void setMaxWidth(LengthExpression maxWidth); @Override float getWidth(float screenWidth); @Override boolean isDrawBorder(); void setDrawBorder(boolean drawBorder); @Override Color getBorderColor(); void setBorderColor(Color borderColor); @Override int getBorderWidth(); void setBorderWidth(int borderWidth); }
MutableScreenOverlayAttributesImpl implements ScreenOverlayAttributes { @Override public String getSourceId() { if (sourceId == null) { CRC32 checksum = new CRC32(); if (sourceUrl != null) { checksum.update((sourceUrl.toExternalForm()).getBytes()); } else { checksum.update(sourceHtml.getBytes()); } sourceId = ID_PREFIX + checksum.getValue(); } return sourceId; } MutableScreenOverlayAttributesImpl();  MutableScreenOverlayAttributesImpl(URL sourceUrl);  MutableScreenOverlayAttributesImpl(String sourceHtml);  MutableScreenOverlayAttributesImpl(AVList params); @Override URL getSourceUrl(); @Override String getSourceHtml(); @Override String getSourceId(); @Override boolean isSourceHtml(); @Override boolean isSourceImage(); @Override ScreenOverlayPosition getPosition(); void setPosition(ScreenOverlayPosition position); @Override LengthExpression getMinHeight(); void setMinHeight(String expression); void setMinHeight(LengthExpression minHeight); @Override LengthExpression getMaxHeight(); void setMaxHeight(String expression); void setMaxHeight(LengthExpression maxHeight); @Override float getHeight(float screenHeight); @Override LengthExpression getMinWidth(); void setMinWidth(String expression); void setMinWidth(LengthExpression minWidth); @Override LengthExpression getMaxWidth(); void setMaxWidth(String expression); void setMaxWidth(LengthExpression maxWidth); @Override float getWidth(float screenWidth); @Override boolean isDrawBorder(); void setDrawBorder(boolean drawBorder); @Override Color getBorderColor(); void setBorderColor(Color borderColor); @Override int getBorderWidth(); void setBorderWidth(int borderWidth);  }