From ecba2e694b24745f2757fc9a126e3dec89f2b1b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 18 Dec 2010 01:54:01 +0100 Subject: [PATCH] Add field to trust accessor that returns whether the trust has a distance. --- src/main/java/net/pterodactylus/sone/template/TrustAccessor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/template/TrustAccessor.java b/src/main/java/net/pterodactylus/sone/template/TrustAccessor.java index 0ac194e..b14d382 100644 --- a/src/main/java/net/pterodactylus/sone/template/TrustAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/TrustAccessor.java @@ -43,6 +43,8 @@ public class TrustAccessor extends ReflectionAccessor { Trust trust = (Trust) object; if ("assigned".equals(member)) { return trust.getExplicit() != null; + } else if ("hasDistance".equals(member)) { + return (trust.getDistance() != null) && (trust.getDistance() != Integer.MAX_VALUE); } return super.get(dataProvider, object, member); } -- 2.7.4