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

    https://github.com/apache/brooklyn-server/pull/340#discussion_r79987656
  
    --- Diff: 
utils/common/src/main/java/org/apache/brooklyn/config/ConfigInheritance.java ---
    @@ -19,63 +19,198 @@
     package org.apache.brooklyn.config;
     
     import java.io.Serializable;
    +import java.util.Map;
     
    +import javax.annotation.Nonnull;
    +import javax.annotation.Nullable;
    +
    +import 
org.apache.brooklyn.config.ConfigInheritances.BasicConfigValueAtContainer;
    +import org.apache.brooklyn.util.collections.CollectionMerger;
    +import org.apache.brooklyn.util.exceptions.ReferenceWithError;
    +import org.apache.brooklyn.util.guava.Maybe;
     import org.apache.brooklyn.util.text.Strings;
     
     import com.google.common.annotations.Beta;
     
     @SuppressWarnings("serial")
    -public abstract class ConfigInheritance implements Serializable {
    +public interface ConfigInheritance extends Serializable {
    +    
    +    /** marker interface for inheritance contexts, for keys which can 
define one or more inheritance patterns;
    +     * implementers can define their own, e.g. in an enum */
    +    public interface ConfigInheritanceContext {}
     
    +    /** @deprecated since 0.10.0 see implementations of this interface */ 
@Deprecated
         @Beta
         public enum InheritanceMode {
             NONE,
             IF_NO_EXPLICIT_VALUE,
             DEEP_MERGE
         }
    -
    -    public static final ConfigInheritance NONE = new None();
    -    public static final ConfigInheritance ALWAYS = new Always();
    -    public static final ConfigInheritance DEEP_MERGE = new Merged();
         
    -    public static ConfigInheritance fromString(String val) {
    -        if (Strings.isBlank(val)) return null;
    -        switch (val.toLowerCase().trim()) {
    -        case "none":
    -            return NONE;
    -        case "always": 
    -            return ALWAYS;
    -        case "deepmerge" :
    -        case "deep_merge" :
    -            return DEEP_MERGE;
    -        default:
    -            throw new IllegalArgumentException("Invalid config-inheritance 
'"+val+"' (legal values are none, always or merge)");
    -        }
    -    }
    +    /** @deprecated since 0.10.0 see implementations of this interface */ 
@Deprecated
    +    public static final ConfigInheritance NONE = new Legacy.None();
    +    /** @deprecated since 0.10.0 see implementations of this interface */ 
@Deprecated
    +    public static final ConfigInheritance ALWAYS = new Legacy.Always();
    +    /** @deprecated since 0.10.0 see implementations of this interface */ 
@Deprecated
    +    public static final ConfigInheritance DEEP_MERGE = new Legacy.Merged();
         
    -    private ConfigInheritance() {}
    +    @Deprecated
    --- End diff --
    
    Include javadoc:
    
    ```
    /**
     * @deprecated since 0.10.0; use the other more specific methods, or 
consider using {@link ConfigInheritances}
     */
    ```


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

Reply via email to