package com.atlassian.bitbucket.internal.importer.event;

import com.atlassian.bitbucket.event.ApplicationEvent;
import com.atlassian.bitbucket.internal.importer.SourceType;

import javax.annotation.Nonnull;

import static java.util.Objects.requireNonNull;

public class ExternalSearchEvent extends ApplicationEvent {
    private final SourceType sourceType;
    private final int pageStart;
    private final int pageSize;
    private final boolean isLastPage;

    protected ExternalSearchEvent(@Nonnull Object source, @Nonnull SourceType sourceType,
                                  int pageSize, int pageStart, boolean isLastPage) {
        super(source);
        this.sourceType = requireNonNull(sourceType, "sourceType");
        this.pageSize = pageSize;
        this.pageStart = pageStart;
        this.isLastPage = isLastPage;
    }

    @Nonnull
    public SourceType getSourceType() {
        return sourceType;
    }

    public int getPageStart() {
        return pageStart;
    }

    public int getPageSize() {
        return pageSize;
    }

    public boolean getIsLastPage() {
        return isLastPage;
    }
}
