X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FReply.kt;fp=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FReply.kt;h=9a3ec6454c9512aa21b4e24060e85e41654061e2;hp=0000000000000000000000000000000000000000;hb=f049280a40ddf05f02400e7f0d93a24dea4545c2;hpb=be005506d77e048c7de43f08771b072951ab82f9 diff --git a/src/main/kotlin/net/pterodactylus/sone/data/Reply.kt b/src/main/kotlin/net/pterodactylus/sone/data/Reply.kt new file mode 100644 index 0000000..9a3ec64 --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/data/Reply.kt @@ -0,0 +1,27 @@ +/** + * Sone - Reply.kt - Copyright © 2020 David ‘Bombe’ Roden + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package net.pterodactylus.sone.data + +import java.util.Comparator.comparing + +/** + * Comparator that orders replies by their time, newest replies first. + */ +@get:JvmName("newestReplyFirst") +val newestReplyFirst: Comparator> = + comparing(Reply<*>::getTime).reversed()