Skip to content

Commit

Permalink
chore: validate max allowed value
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdev01 committed Nov 21, 2024
1 parent e9c3fa8 commit 0d6fb96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/main/java/io/github/jpdev/asaassdk/doc/Examples.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ private static void paging() {
PixTransactionReader reader = PixTransaction.reader();
ResourceSet<PixTransaction> page0 = reader.read();
ResourceSet<PixTransaction> page1 = reader.nextPage().read();

ArrayList<PixTransaction> pixTransactions = new ArrayList<>();
pixTransactions.addAll(page0.getData());
pixTransactions.addAll(page1.getData());

for (PixTransaction pixTransaction : pixTransactions) {
System.out.println(pixTransaction.getId().equals("6b212665-4963-460d-9005-3805281790a4"));
}
}

private static void pixTransaction() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ public abstract class Reader<T> {
public int limit = 10;
public long offset = 0;

private static final int LIMIT_MAX_VALUE = 100;

public List<FilterVO> activeFilters;

public Integer getLimit() {
return limit;
}

public Reader<T> setLimit(Integer limit) {
if (limit > LIMIT_MAX_VALUE) throw new IllegalArgumentException("Limit cannot be greater than " + LIMIT_MAX_VALUE);

this.limit = limit;
return this;
}
Expand Down

0 comments on commit 0d6fb96

Please sign in to comment.