Skip to content

Commit 2ea93f3

Browse files
committed
Merge pull request navnorth#8 from scottbw/master
Added method for adding arbitrary maps to an activity
2 parents dedf674 + 4fd242d commit 2ea93f3

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/com/navnorth/learningregistry/LRActivity.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,18 @@ public Object getResourceData()
123123
return returnableData;
124124
}
125125

126+
/**
127+
* Add an arbitrary map of key-value pairs as a measure to the verb
128+
* @param properties
129+
* @return True if added, false if not (due to missing required fields or lack of "verb")
130+
*/
131+
public boolean addMeasureToVerb(Map<String, Object> properties)
132+
{
133+
String[] pathKeys = {"verb"};
134+
return addChild("measure", properties, pathKeys);
135+
}
136+
137+
126138
/**
127139
* Add a mesure object to the verb within this activity
128140
*
@@ -166,8 +178,7 @@ public boolean addMeasureToVerb(String measureType, Number value, Number scaleMi
166178
container.put("sampleSize", sampleSize);
167179
}
168180

169-
String[] pathKeys = {"verb"};
170-
return addChild("measure", container, pathKeys);
181+
return addMeasureToVerb(container);
171182
}
172183

173184
/**

0 commit comments

Comments
 (0)