Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1037#discussion_r45631581
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/enricher/stock/Enrichers.java ---
    @@ -891,6 +892,39 @@ protected static int count(Iterable<? extends Object> 
vals, boolean includeNullV
             return result;
         }
         
    +    @Beta
    +    public static class ComputingIsQuorate<T extends Object> implements 
Function<Collection<T>, T> {
    +        protected final TypeToken<T> typeToken;
    +        protected final QuorumCheck quorumCheck;
    +        protected final int totalSize;
    +
    +        @SuppressWarnings({ "unchecked", "rawtypes" })
    +        public ComputingIsQuorate(TypeToken<T> typeToken, QuorumCheck 
quorumCheck, int totalSize) {
    +            this.quorumCheck = quorumCheck;
    +            this.totalSize = totalSize;
    +
    +            if (typeToken!=null && 
TypeToken.of(Boolean.class).isAssignableFrom(typeToken.getType())) {
    +                this.typeToken = typeToken;
    +            } else if (typeToken==null || 
typeToken.isAssignableFrom(Boolean.class)) {
    +                this.typeToken = (TypeToken)TypeToken.of(Boolean.class);
    +            } else {
    +                throw new IllegalArgumentException("Type "+typeToken+" is 
not valid for "+this);
    --- End diff --
    
    Should indicate what was expected.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to