From: David ‘Bombe’ Roden Date: Sat, 18 Dec 2010 00:54:20 +0000 (+0100) Subject: Add field to trust accessor that denotes whether the trust can be incremented. X-Git-Tag: 0.4^2~8^2~46 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=97575e0f0e6dd16852becb1246bf9d3454b7de68;p=Sone.git Add field to trust accessor that denotes whether the trust can be incremented. --- diff --git a/src/main/java/net/pterodactylus/sone/template/TrustAccessor.java b/src/main/java/net/pterodactylus/sone/template/TrustAccessor.java index b14d382..4dfd81e 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 ("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); }