Add field to trust accessor that returns whether the trust has a distance.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 18 Dec 2010 00:54:01 +0000 (01:54 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 18 Dec 2010 00:54:01 +0000 (01:54 +0100)
src/main/java/net/pterodactylus/sone/template/TrustAccessor.java

index 0ac194e..b14d382 100644 (file)
@@ -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);
        }