Skip to content

Commit

Permalink
fix: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaCambi77 committed Oct 27, 2023
1 parent 17473dc commit 7ec18c8
Showing 1 changed file with 0 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@
@ToString
public class TrackedEntityQueryParams {

public static final int DEFAULT_PAGE = 1;

public static final int DEFAULT_PAGE_SIZE = 50;

/** Each attribute will affect the final SQL query. Some attributes are filtered on. */
private final Map<TrackedEntityAttribute, List<QueryFilter>> filters = new HashMap<>();

Expand Down Expand Up @@ -133,18 +129,6 @@ public class TrackedEntityQueryParams {
/** End date for event for the given program. */
private Date eventEndDate;

/** Page number. */
private Integer page;

/** Page size. */
private Integer pageSize;

/** Indicates whether to include the total number of pages in the paging response. */
private boolean totalPages;

/** Indicates whether paging should be skipped. */
private boolean skipPaging;

/** Indicates if there is a maximum te retrieval limit. 0 no limit. */
private int maxTeLimit;

Expand Down Expand Up @@ -339,26 +323,6 @@ public boolean hasUniqueFilter() {
return false;
}

/** Indicates whether paging is enabled. */
public boolean isPaging() {
return !isSkipPaging();
}

/** Returns the page number, falls back to default value of 1 if not specified. */
public int getPageWithDefault() {
return page != null && page > 0 ? page : DEFAULT_PAGE;
}

/** Returns the page size, falls back to default value of 50 if not specified. */
public int getPageSizeWithDefault() {
return pageSize != null && pageSize >= 0 ? pageSize : DEFAULT_PAGE_SIZE;
}

/** Returns the offset based on the page number and page size. */
public int getOffset() {
return (getPageWithDefault() - 1) * getPageSizeWithDefault();
}

/** Returns attributes that are only ordered by and not present in any filter. */
public Set<TrackedEntityAttribute> getLeftJoinAttributes() {
return SetUtils.difference(getOrderAttributes(), filters.keySet());
Expand Down Expand Up @@ -554,42 +518,6 @@ public TrackedEntityQueryParams setEventEndDate(Date eventEndDate) {
return this;
}

public Integer getPage() {
return page;
}

public TrackedEntityQueryParams setPage(Integer page) {
this.page = page;
return this;
}

public Integer getPageSize() {
return pageSize;
}

public TrackedEntityQueryParams setPageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}

public boolean isTotalPages() {
return totalPages;
}

public TrackedEntityQueryParams setTotalPages(boolean totalPages) {
this.totalPages = totalPages;
return this;
}

public boolean isSkipPaging() {
return skipPaging;
}

public TrackedEntityQueryParams setSkipPaging(boolean skipPaging) {
this.skipPaging = skipPaging;
return this;
}

public int getMaxTeLimit() {
return maxTeLimit;
}
Expand Down

0 comments on commit 7ec18c8

Please sign in to comment.