Skip to content

Commit 1e4396d

Browse files
committed
Added ability to remove parameters by setting them to null
1 parent c9d90b8 commit 1e4396d

5 files changed

Lines changed: 490 additions & 273 deletions

File tree

nbproject/project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ meta.inf.dir=${src.dir}/META-INF
9494
mkdist.disabled=true
9595
platform.active=default_platform
9696
project.licensePath=./nbproject/licenseheader.txt
97-
project.version =1.0.0
97+
project.version =1.1.0
9898
run.classpath=\
9999
${javac.classpath}:\
100100
${build.classes.dir}

src/com/ge/corporate/piwik/tracking/PiwikJsonObject.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,15 @@ public String get(String key){
3737
}
3838

3939
/**
40-
* Puts a custom variable at this custom key.
40+
* Returns true if this object contains no custom key-value pairs.
41+
* @return true if this object contains no custom key-value pairs
42+
*/
43+
public boolean isEmpty(){
44+
return size() == 0;
45+
}
46+
47+
/**
48+
* Puts a custom value at this custom key.
4149
* @param key key to store value at
4250
* @param value value to store at specified key
4351
* @return previous value stored at key if present, null otherwise
@@ -55,6 +63,14 @@ public String remove(String key){
5563
return map.remove(key);
5664
}
5765

66+
/**
67+
* Returns the number of custom key-value pairs.
68+
* @return the number of custom key-value pairs
69+
*/
70+
public int size(){
71+
return map.size();
72+
}
73+
5874
/**
5975
* Produces the JSON string representing this object.<br>
6076
* <br>

0 commit comments

Comments
 (0)