yangys
2024-04-04 2cf2921440e7473ae50796c2cb688f609b3a7995
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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;
    }
}