From f10d40f746f6c7c716f783da11791d28c1117447 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 9 Nov 2013 16:33:47 +0100 Subject: [PATCH] Add function that transforms a Sone into its nice name. --- src/main/java/net/pterodactylus/sone/data/Sone.java | 7 +++++++ 1 file changed, 7 insertions(+) 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() { -- 2.7.4