@Override public String toString() { final StringBuilder buf = new StringBuilder(); buf.append(ID).append(':'); switch(contentItem.getContentType()) { case MISC: buf.append(ContentType.MISC.toString()); break; case MODULE: buf.append(ContentType.MODULE.toString()); break; case BUNDLE: buf.append(ContentType.BUNDLE.toString()); break; default: throw new IllegalStateException(PatchLogger.ROOT_LOGGER.unsupportedContentType(contentItem.getContentType().name())); } return buf.append(':').append(contentItem.getRelativePath()).toString(); } }
@Override public String toString() { final StringBuilder buf = new StringBuilder(); buf.append(ID).append(':'); switch(contentItem.getContentType()) { case MISC: buf.append(ContentType.MISC.toString()); break; case MODULE: buf.append(ContentType.MODULE.toString()); break; case BUNDLE: buf.append(ContentType.BUNDLE.toString()); break; default: throw new IllegalStateException(PatchLogger.ROOT_LOGGER.unsupportedContentType(contentItem.getContentType().name())); } return buf.append(':').append(contentItem.getRelativePath()).toString(); } }
static int hashCode(final ContentItem item) { final ContentType type = item.getContentType(); switch (type) { case MODULE: case BUNDLE: final ModuleItem module = (ModuleItem) item; final String[] path = module.getName().split("\\."); return hashCode(type.toString(), module.getSlot(), path); case MISC: final MiscContentItem misc = (MiscContentItem) item; return hashCode(type.toString(), misc.getName(), misc.getPath()); default: throw new IllegalStateException(); } }
static int hashCode(final ContentItem item) { final ContentType type = item.getContentType(); switch (type) { case MODULE: case BUNDLE: final ModuleItem module = (ModuleItem) item; final String[] path = module.getName().split("\\."); return hashCode(type.toString(), module.getSlot(), path); case MISC: final MiscContentItem misc = (MiscContentItem) item; return hashCode(type.toString(), misc.getName(), misc.getPath()); default: throw new IllegalStateException(); } }