tech.grasshopper.pdf.section.attributes.DeviceSection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cucumber-pdf-report Show documentation
Show all versions of cucumber-pdf-report Show documentation
Generates Cucumber execution report in PDF format
The newest version!
package tech.grasshopper.pdf.section.attributes;
import java.util.List;
import java.util.function.Consumer;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import tech.grasshopper.pdf.data.AttributeData.DeviceData;
import tech.grasshopper.pdf.data.DisplayData;
import tech.grasshopper.pdf.destination.Destination;
import tech.grasshopper.pdf.pojo.cucumber.Device;
@SuperBuilder
@EqualsAndHashCode(callSuper = false)
public class DeviceSection extends AttributeSection {
@Override
public DisplayData createDisplayData(int fromIndex, int toIndex) {
List pageDevices = ((DeviceData) attributeData).getDevices().subList(fromIndex, toIndex);
return DeviceData.builder().devices(pageDevices).build();
}
@Override
public int maxDataCountPerPage() {
return reportConfig.getDeviceConfig().dataCount();
}
@Override
public String attributeType() {
return "DEVICE";
}
@Override
public Consumer attributeDestinationConsumer() {
return destinations::addDeviceDestination;
}
}