From d39e39ed52c231bd7331c4b2da8e55ffbed081f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 12 Oct 2013 17:30:43 +0200 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20apply=20function=20to=20optional?= =?utf8?q?s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/data/Identified.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/data/Identified.java b/src/main/java/net/pterodactylus/sone/data/Identified.java index 4892479..bd1a91f 100644 --- a/src/main/java/net/pterodactylus/sone/data/Identified.java +++ b/src/main/java/net/pterodactylus/sone/data/Identified.java @@ -20,7 +20,6 @@ package net.pterodactylus.sone.data; import javax.annotation.Nonnull; import com.google.common.base.Function; -import com.google.common.base.Optional; /** * Interface for all objects that expose an ID. @@ -30,12 +29,12 @@ import com.google.common.base.Optional; public interface Identified { /** Function to extract the ID from an optional. */ - public static final Function, Optional> GET_ID = new Function, Optional>() { + public static final Function GET_ID = new Function() { @Override @Nonnull - public Optional apply(Optional identified) { - return (identified == null) ? Optional.absent() : (identified.isPresent() ? Optional.of(identified.get().getId()) : Optional.absent()); + public String apply(Identified identified) { + return (identified == null) ? null : identified.getId(); } }; -- 2.7.4