com.global.api.builders.UserReportBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of globalpayments-sdk Show documentation
Show all versions of globalpayments-sdk Show documentation
API for processing payments through Global Payments
package com.global.api.builders;
import com.global.api.entities.enums.*;
import com.global.api.entities.reporting.SearchCriteria;
import com.global.api.entities.reporting.SearchCriteriaBuilder;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Getter
@Setter
public class UserReportBuilder extends ReportBuilder {
@Getter @Setter private int page = 1; // 1: DEFAULT PARAM VALUE
@Getter @Setter private int pageSize = 5; // 5: DEFAULT PARAM VALUE
public SortDirection order;
public MerchantAccountsSortProperty accountOrderBy;
public TransactionType transactionType;
public SearchCriteriaBuilder _searchBuilder;
public TransactionModifier transactionModifier = TransactionModifier.None;
public UserReportBuilder(ReportType type, Class clazz) {
super(type, clazz);
}
public SearchCriteriaBuilder getSearchBuilder() {
if (_searchBuilder == null) {
_searchBuilder = new SearchCriteriaBuilder(this);
}
return _searchBuilder;
}
@Override
public void setupValidations() {
}
public UserReportBuilder orderBy(MerchantAccountsSortProperty orderBy, SortDirection direction) {
accountOrderBy = orderBy;
order = (direction != null) ? direction : SortDirection.Ascending;
return this;
}
public UserReportBuilder withModifier(TransactionModifier transactionModifier) {
this.transactionModifier = transactionModifier;
return this;
}
public UserReportBuilder withAccountId(String accountId) {
this.getSearchBuilder().setAccountId(accountId);
return this;
}
public SearchCriteriaBuilder where(SearchCriteria criteria, T value) {
return getSearchBuilder().and(criteria, value);
}
public UserReportBuilder withPaging(int page, int pageSize) {
this.page = page;
this.pageSize = pageSize;
return this;
}
}