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

index b14d382..4dfd81e 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 ("maximum".equals(member)) {
+                       return ((trust.getExplicit() != null) && (trust.getExplicit() >= 100)) || ((trust.getImplicit() != null) && (trust.getImplicit() >= 100));
                } else if ("hasDistance".equals(member)) {
                        return (trust.getDistance() != null) && (trust.getDistance() != Integer.MAX_VALUE);
                }