GitHub user sjcorbett opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/356

    Adds boolean ConfigKey.isNonNull() method

    Use to enforce non-null values for particular config keys.
    
    Validity checks are made in `AbstractEntity.setConfigInternal`, so 
`setConfig(required, null)` should fail, and in `InternalEntityFactory` after 
setting config values on a newly-created entity, so forgetting to set a value 
on a required key should also fail. 
    
    The `InternalEntityFactory` check will only work for `ConfigKeys` defined 
on the interfaces implemented by the entity. I think the combination of the two 
checks is sufficient.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sjcorbett/incubator-brooklyn non-null-config

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/356.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #356
    
----
commit 1eb10bc3e43b137105e2a4ef1b30447ddbafc68e
Author: Sam Corbett <[email protected]>
Date:   2014-11-24T12:19:21Z

    Adds boolean ConfigKey.isNonNull() method
    
    Use to enforce non-null values for particular config keys.
    
    Validity checks are made in AbstractEntity.setConfigInternal, so
    setConfig(required, null) should fail, and in InternalEntityFactory
    after setting config values on a newly-created entity, so forgetting to
    set a value on a required key should also fail.

----


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