From: David ‘Bombe’ Roden Date: Sat, 9 Nov 2013 15:33:47 +0000 (+0100) Subject: Add function that transforms a Sone into its nice name. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f10d40f746f6c7c716f783da11791d28c1117447;p=Sone.git Add function that transforms a Sone into its nice name. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 8d270c3..a8e8009 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -108,6 +108,13 @@ public interface Sone extends Identified, Fingerprintable, Comparable { }; + public static final Function TO_NICE_NAME = new Function() { + @Override + public String apply(Sone sone) { + return (sone == null) ? null : getNiceName(sone); + } + }; + /** Comparator that sorts Sones by last activity (least recent active first). */ public static final Comparator LAST_ACTIVITY_COMPARATOR = new Comparator() {