-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[chain] Initial contribution #97
Conversation
@cweitkamp: WDYT? |
This looks cool. 😎 Very useful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Looks straight forward even if the ValueTransformationProvider
is a black box for me.
I left a few comments.
|
||
## Example: Door lock | ||
|
||
A lock that can report its status and accepts commands as JSON and accepts commands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lock that can report its status and accepts commands as JSON and accepts commands. | |
A lock that can report its status and accepts commands in JSON. |
@Override | ||
public @Nullable Profile createProfile(ProfileTypeUID profileTypeUID, ProfileCallback callback, | ||
ProfileContext profileContext) { | ||
return new ChainTransformationProfile(callback, profileContext, valueTransformationProvider); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC you should check for matching ProfileTypeUID
or return null
otherwise. I am not sure if the calling instance checks the factory for getSupportedProfileTypeUIDs()
or not.
return new ChainTransformationProfile(callback, profileContext, valueTransformationProvider); | |
return ChainTransformationProfile.PROFILE_TYPE_UID.equals(profileTypeUID) ? new ChainTransformationProfile(callback, profileContext, valueTransformationProvider) : null; |
* @author Jan N. Klug - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class TestProfileContext implements ProfileContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really need this helper class? Or can you mock it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There is a remaining conflict in bundles/pom.xml
.
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
* Initial contribution Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This adds a profile that allows chaining transformations.
Signed-off-by: Jan N. Klug jan.n.klug@rub.de