From: David ‘Bombe’ Roden Date: Sat, 18 Dec 2010 00:54:01 +0000 (+0100) Subject: Add field to trust accessor that returns whether the trust has a distance. X-Git-Tag: 0.4^2~8^2~47 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ecba2e694b24745f2757fc9a126e3dec89f2b1b6;p=Sone.git Add field to trust accessor that returns whether the trust has a distance. --- 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); }