MCPcopy Create free account
hub / github.com/EsperoTech/yaade / PropertyList

Class PropertyList

server/src/main/java/com/postman/collection/PropertyList.java:30–241  ·  view source on GitHub ↗

Postman SDK analog: PropertyList Extends ArrayList with Map like capabilities, including: Support for retrieving by variable key which is always com.postman.collection.Property#getKey() Su

Source from the content-addressed store, hash-verified

28 *
29 */
30public class PropertyList<T> extends ArrayList<Property>
31{
32 /**
33 * Returns a PropertyList populated with the contents of <code>vars</code>
34 * @param vars ArrayList&#60;Property&#62; of variables
35 */
36
37 public PropertyList(ArrayList<Property> vars) {
38 super(vars);
39 }
40
41
42 /**
43 *
44 * Returns an empty <code>PropertyList</code>
45 */
46 public PropertyList() {
47 super(new ArrayList<Property>());
48 }
49
50
51 /**
52 *
53 *
54 * Get a variable whose key matches <code>key</code>, or null if it is not present
55 *
56 * @param key
57 * @return Property
58 */
59 public Property get(String key) {
60
61
62 for(Property curVar : this) {
63 String curVarKey;
64 if(key == null) {
65 curVarKey = curVar.getKey();
66 if(curVarKey == null) {
67 return curVar;
68 }
69 }
70 else if (curVar.getKey() != null && curVar.getKey().equals(key))
71 return curVar;
72 }
73
74
75 return null;
76 }
77
78
79 /**
80 * @param key
81 * @return boolean
82 */
83 public boolean containsKey(String key) {
84 return(this.get(key) != null);
85 }
86
87

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected