Skip to content
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

Add API for setting task level properties from benchmark context #3

Open
ceresek opened this issue Feb 15, 2016 · 0 comments
Open

Add API for setting task level properties from benchmark context #3

ceresek opened this issue Feb 15, 2016 · 0 comments

Comments

@ceresek
Copy link

ceresek commented Feb 15, 2016

Apparently, there is no elegant way of setting a task level property from benchmark context.

For setting a context level property, one can simply do:
ContextBuilder builder ...
builder.setProperty ("name", "value);

For setting a task level property, one probably has to do:
Task task ...
if (!task.isSetProperties ()) task.setProperties(new Properties ());
for (Property property : task.getProperties ().getProperty ())
if (property.isSetName () && name.equals (property.getName ())) {
property.setValue (value);
...
}
task.getProperties ().getProperty ().add (new Property ().withName (name).withValue (value));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant