package com.qianwen.core.mp.support;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import java.io.Serializable;
|
import java.util.Collections;
|
import java.util.List;
|
|
/* loaded from: blade-starter-mybatis-9.3.0.0-SNAPSHOT.jar:org/springblade/core/mp/support/BladePage.class */
|
public class BladePage<T> implements Serializable {
|
private static final long serialVersionUID = 1;
|
private List<T> records = Collections.emptyList();
|
private long total = 0;
|
private long size = 10;
|
private long current = serialVersionUID;
|
|
public void setRecords(final List<T> records) {
|
this.records = records;
|
}
|
|
public void setTotal(final long total) {
|
this.total = total;
|
}
|
|
public void setSize(final long size) {
|
this.size = size;
|
}
|
|
public void setCurrent(final long current) {
|
this.current = current;
|
}
|
|
public boolean equals(final Object o) {
|
if (o == this) {
|
return true;
|
}
|
if (o instanceof BladePage) {
|
BladePage<?> other = (BladePage) o;
|
if (other.canEqual(this) && getTotal() == other.getTotal() && getSize() == other.getSize() && getCurrent() == other.getCurrent()) {
|
Object this$records = getRecords();
|
Object other$records = other.getRecords();
|
return this$records == null ? other$records == null : this$records.equals(other$records);
|
}
|
return false;
|
}
|
return false;
|
}
|
|
protected boolean canEqual(final Object other) {
|
return other instanceof BladePage;
|
}
|
|
public int hashCode() {
|
long $total = getTotal();
|
int result = (1 * 59) + ((int) (($total >>> 32) ^ $total));
|
long $size = getSize();
|
int result2 = (result * 59) + ((int) (($size >>> 32) ^ $size));
|
long $current = getCurrent();
|
int result3 = (result2 * 59) + ((int) (($current >>> 32) ^ $current));
|
Object $records = getRecords();
|
return (result3 * 59) + ($records == null ? 43 : $records.hashCode());
|
}
|
|
public String toString() {
|
return "BladePage(records=" + getRecords() + ", total=" + getTotal() + ", size=" + getSize() + ", current=" + getCurrent() + ")";
|
}
|
|
public List<T> getRecords() {
|
return this.records;
|
}
|
|
public long getTotal() {
|
return this.total;
|
}
|
|
public long getSize() {
|
return this.size;
|
}
|
|
public long getCurrent() {
|
return this.current;
|
}
|
|
public static <T> BladePage<T> of(IPage<T> page) {
|
BladePage<T> bladePage = new BladePage<>();
|
bladePage.setRecords(page.getRecords());
|
bladePage.setTotal(page.getTotal());
|
bladePage.setSize(page.getSize());
|
bladePage.setCurrent(page.getCurrent());
|
return bladePage;
|
}
|
}
|