admin管理员组文章数量:1531357
2024年4月7日发(作者:)
private Integer sort;
private Integer priority;
public TestDto(Integer id, Integer sort, Integer priority) {
= id;
= sort;
ty = priority;
}
public TestDto() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
= id;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
= sort;
}
public Integer getPriority() {
return priority;
}
public void setPriority(Integer priority) {
ty = priority;
}
@Override
public String toString() {
return "TestDto{" +
"id=" + id +
", sort=" + sort +
", priority=" + priority +
'}';
}
public static List
List
TestDto dto1=new TestDto(1,2,3);
TestDto dto2=new TestDto(2,3,1);
TestDto dto3=new TestDto(3,1,2);
(dto1);
(dto2);
(dto3);
return dtos;
}
}
版权声明:本文标题:JAVA里List集合中的对象根据对象的某个属性值降序或者升序排序 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1712454716a361126.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论