private Attachment convert(final Path source, final ResultsVisitor visitor, final ru.yandex.qatools.allure.model.Attachment attachment) { final Path attachmentFile = source.resolve(attachment.getSource()); if (Files.isRegularFile(attachmentFile)) { final Attachment found = visitor.visitAttachmentFile(attachmentFile); if (Objects.nonNull(attachment.getType())) { found.setType(attachment.getType()); } if (Objects.nonNull(attachment.getTitle())) { found.setName(attachment.getTitle()); } return found; } else { visitor.error("Could not find attachment " + attachment.getSource() + " in directory " + source); return new Attachment() .setType(attachment.getType()) .setName(attachment.getTitle()) .setSize(0L); } }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { String theTitle; theTitle = this.getTitle(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "title", theTitle), currentHashCode, theTitle); } { String theSource; theSource = this.getSource(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "source", theSource), currentHashCode, theSource); } { String theType; theType = this.getType(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType); } { Integer theSize; theSize = this.getSize(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "size", theSize), currentHashCode, theSize); } return currentHashCode; }
private Attachment convert(final Path source, final ResultsVisitor visitor, final ru.yandex.qatools.allure.model.Attachment attachment) { final Path attachmentFile = source.resolve(attachment.getSource()); if (Files.isRegularFile(attachmentFile)) { final Attachment found = visitor.visitAttachmentFile(attachmentFile); if (Objects.nonNull(attachment.getType())) { found.setType(attachment.getType()); } if (Objects.nonNull(attachment.getTitle())) { found.setName(attachment.getTitle()); } return found; } else { visitor.error("Could not find attachment " + attachment.getSource() + " in directory " + source); return new Attachment() .setType(attachment.getType()) .setName(attachment.getTitle()) .setSize(0L); } }