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

    https://github.com/apache/incubator-brooklyn/pull/1017#discussion_r45091680
  
    --- Diff: 
api/src/main/java/org/apache/brooklyn/api/typereg/RegisteredType.java ---
    @@ -38,19 +46,24 @@
         String getDescription();
         String getIconUrl();
     
    -    /** @return the java type or a supertype thereof that this registered 
type represents.
    +    /** @return all declared supertypes or super-interfaces of this 
registered type,
    +     * consisting of a collection of {@link Class} or {@link 
RegisteredType}
          * <p>
    -     * For beans, this is the type that the {@link BrooklynTypeRegistry} 
will create. 
    -     * For specs, this is what the spec that will be created points at 
    -     * (e.g. the concrete {@link Entity}, not the {@link EntitySpec});
    +     * This should normally include at least one {@link Class} object:
    +     * For beans, this should include the java type that the {@link 
BrooklynTypeRegistry} will create. 
    +     * For specs, this should refer to the {@link BrooklynObject} type 
that the created spec will point at 
    +     * (e.g. the concrete {@link Entity}, not the {@link EntitySpec}).
          * <p>
    -     * In some cases this may return an interface or a super-type of what 
will actually be created, 
    +     * This may not necessarily return the most specific java class or 
classes;
          * such as if the concrete type is private and callers should know 
only about a particular public interface,
          * or if precise type details are unavailable and all that is known at 
creation is some higher level interface/supertype
          * (e.g. this may return {@link Entity} even though the spec points at 
a specific subclass,
    -     * for instance because the YAML has not yet been parsed or OSGi 
bundles downloaded). 
    +     * for instance because the YAML has not yet been parsed or OSGi 
bundles downloaded).
    +     * <p>
    +     * This may include other registered types such as marker interfaces.
          */
    -    Class<?> getJavaType();
    +    @Beta
    +    @Nullable Set<Object> getSuperTypes();
    --- End diff --
    
    Any particular reason this is `@Nullable`? Feels better for it to be the 
opposite. Its callers already seem to assume otherwise (e.g. 
https://github.com/apache/incubator-brooklyn/pull/1017/files#diff-2c1cbcb42656df77efc28ab3153cb1e5R250).


---
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