tech.grasshopper.reporter.destination.Destination Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pdfextentreporter Show documentation
Show all versions of pdfextentreporter Show documentation
Creating Extent reports in PDF format
The newest version!
package tech.grasshopper.reporter.destination;
import java.util.ArrayList;
import java.util.List;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageXYZDestination;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.Data;
@Data
@Builder
public class Destination {
private String name;
private int id;
private PDPage page;
@Default
private int xCoord = 0;
@Default
private int yCoord = 0;
public PDPageXYZDestination createPDPageDestination() {
PDPageXYZDestination destination = new PDPageXYZDestination();
destination.setPage(page);
destination.setLeft(xCoord);
destination.setTop(yCoord);
return destination;
}
@Data
public static class DestinationStore {
private Destination dashboardDestination;
private List attributeSummaryDestinations = new ArrayList<>();
private List testDestinations = new ArrayList<>();
private List topLevelTestDestinations = new ArrayList<>();
private List attributeDetailDestinations = new ArrayList<>();
private List testMediaDestinations = new ArrayList<>();
public void addAttributeSummaryDestination(Destination destination) {
attributeSummaryDestinations.add(destination);
}
public void addTestDestination(Destination destination) {
testDestinations.add(destination);
}
public void addTopLevelTestDestination(Destination destination) {
topLevelTestDestinations.add(destination);
}
public void addAttributeDetailDestination(Destination destination) {
attributeDetailDestinations.add(destination);
}
public void addTestMediaDestination(Destination destination) {
testMediaDestinations.add(destination);
}
}
}