yangys
2024-05-30 a3686cfa49bf53fb91a2ceb960cf15b3ebdac641
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
package com.qianwen.core.oss.model;
 
import io.minio.messages.Item;
import io.minio.messages.Owner;
import java.util.Date;
import com.qianwen.core.tool.utils.DateUtil;
 
public class MinioItem {
    private String objectName;
    private Date lastModified;
    private String etag;
    private Long size;
    private String storageClass;
    private Owner owner;
    private boolean isDir;
    private String category;
 
    public void setObjectName(final String objectName) {
        this.objectName = objectName;
    }
 
    public void setLastModified(final Date lastModified) {
        this.lastModified = lastModified;
    }
 
    public void setEtag(final String etag) {
        this.etag = etag;
    }
 
    public void setSize(final Long size) {
        this.size = size;
    }
 
    public void setStorageClass(final String storageClass) {
        this.storageClass = storageClass;
    }
 
    public void setOwner(final Owner owner) {
        this.owner = owner;
    }
 
    public void setDir(final boolean isDir) {
        this.isDir = isDir;
    }
 
    public void setCategory(final String category) {
        this.category = category;
    }
 
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (o instanceof MinioItem) {
            MinioItem other = (MinioItem) o;
            if (other.canEqual(this) && isDir() == other.isDir()) {
                Object this$size = getSize();
                Object other$size = other.getSize();
                if (this$size == null) {
                    if (other$size != null) {
                        return false;
                    }
                } else if (!this$size.equals(other$size)) {
                    return false;
                }
                Object this$objectName = getObjectName();
                Object other$objectName = other.getObjectName();
                if (this$objectName == null) {
                    if (other$objectName != null) {
                        return false;
                    }
                } else if (!this$objectName.equals(other$objectName)) {
                    return false;
                }
                Object this$lastModified = getLastModified();
                Object other$lastModified = other.getLastModified();
                if (this$lastModified == null) {
                    if (other$lastModified != null) {
                        return false;
                    }
                } else if (!this$lastModified.equals(other$lastModified)) {
                    return false;
                }
                Object this$etag = getEtag();
                Object other$etag = other.getEtag();
                if (this$etag == null) {
                    if (other$etag != null) {
                        return false;
                    }
                } else if (!this$etag.equals(other$etag)) {
                    return false;
                }
                Object this$storageClass = getStorageClass();
                Object other$storageClass = other.getStorageClass();
                if (this$storageClass == null) {
                    if (other$storageClass != null) {
                        return false;
                    }
                } else if (!this$storageClass.equals(other$storageClass)) {
                    return false;
                }
                Object this$owner = getOwner();
                Object other$owner = other.getOwner();
                if (this$owner == null) {
                    if (other$owner != null) {
                        return false;
                    }
                } else if (!this$owner.equals(other$owner)) {
                    return false;
                }
                Object this$category = getCategory();
                Object other$category = other.getCategory();
                return this$category == null ? other$category == null : this$category.equals(other$category);
            }
            return false;
        }
        return false;
    }
 
    protected boolean canEqual(final Object other) {
        return other instanceof MinioItem;
    }
 
    public int hashCode() {
        int result = (1 * 59) + (isDir() ? 79 : 97);
        Object $size = getSize();
        int result2 = (result * 59) + ($size == null ? 43 : $size.hashCode());
        Object $objectName = getObjectName();
        int result3 = (result2 * 59) + ($objectName == null ? 43 : $objectName.hashCode());
        Object $lastModified = getLastModified();
        int result4 = (result3 * 59) + ($lastModified == null ? 43 : $lastModified.hashCode());
        Object $etag = getEtag();
        int result5 = (result4 * 59) + ($etag == null ? 43 : $etag.hashCode());
        Object $storageClass = getStorageClass();
        int result6 = (result5 * 59) + ($storageClass == null ? 43 : $storageClass.hashCode());
        Object $owner = getOwner();
        int result7 = (result6 * 59) + ($owner == null ? 43 : $owner.hashCode());
        Object $category = getCategory();
        return (result7 * 59) + ($category == null ? 43 : $category.hashCode());
    }
 
    public String toString() {
        return "MinioItem(objectName=" + getObjectName() + ", lastModified=" + getLastModified() + ", etag=" + getEtag() + ", size=" + getSize() + ", storageClass=" + getStorageClass() + ", owner=" + getOwner() + ", isDir=" + isDir() + ", category=" + getCategory() + ")";
    }
 
    public String getObjectName() {
        return this.objectName;
    }
 
    public Date getLastModified() {
        return this.lastModified;
    }
 
    public String getEtag() {
        return this.etag;
    }
 
    public Long getSize() {
        return this.size;
    }
 
    public String getStorageClass() {
        return this.storageClass;
    }
 
    public Owner getOwner() {
        return this.owner;
    }
 
    public boolean isDir() {
        return this.isDir;
    }
 
    public String getCategory() {
        return this.category;
    }
 
    public MinioItem(Item item) {
        this.objectName = item.objectName();
        this.lastModified = DateUtil.toDate(item.lastModified().toLocalDateTime());
        this.etag = item.etag();
        this.size = Long.valueOf(item.size());
        this.storageClass = item.storageClass();
        this.owner = item.owner();
        this.isDir = item.isDir();
        this.category = this.isDir ? "dir" : "file";
    }
}