brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Sensors chained for service up
Date Fri, 29 Aug 2014 11:49:39 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/131#discussion_r16893742
  
    --- Diff: core/src/main/java/brooklyn/enricher/Enrichers.java ---
    @@ -443,41 +518,106 @@ public String toString() {
             }
         }
     
    -    private static class ConcreteInitialBuilder extends InitialBuilder<ConcreteInitialBuilder>
{
    +    public abstract static class AbstractUpdatingMapBuilder<S, TKey, TVal, B extends
AbstractUpdatingMapBuilder<S, TKey, TVal, B>> extends AbstractEnricherBuilder<B>
{
    +        protected AttributeSensor<Map<TKey,TVal>> targetSensor;
    +        protected AttributeSensor<? extends S> fromSensor;
    +        protected TKey key;
    +        protected Function<S, ? extends TVal> computing;
    +        protected Boolean removingIfResultIsNull;
    +        
    +        public AbstractUpdatingMapBuilder(AttributeSensor<Map<TKey,TVal>>
target) {
    +            super(UpdatingMap.class);
    +            this.targetSensor = target;
    +        }
    +        @SuppressWarnings({ "unchecked", "rawtypes" })
    +        public <S2 extends S> UpdatingMapBuilder<S2,TKey,TVal> from(AttributeSensor<S2>
fromSensor) {
    --- End diff --
    
    If the point of the class is to re-use it for subclassing then why the method returns
a specific sub-class? There are similar cases for the other enricher builders, I can't see
the reasoning.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message