From db5aee21d2827d548a403731cb9ea090991f212d Mon Sep 17 00:00:00 2001 From: Alejandro Revilla Date: Thu, 18 Aug 2016 21:58:26 -0300 Subject: [PATCH] reviewd addTag, added hasTag --- modules/minigl/src/main/java/org/jpos/gl/GLEntry.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/minigl/src/main/java/org/jpos/gl/GLEntry.java b/modules/minigl/src/main/java/org/jpos/gl/GLEntry.java index c0de8c9a66..0974ebe0fa 100644 --- a/modules/minigl/src/main/java/org/jpos/gl/GLEntry.java +++ b/modules/minigl/src/main/java/org/jpos/gl/GLEntry.java @@ -264,9 +264,14 @@ public Element toXML (boolean deep) { * @return this */ public GLEntry addTag (String tag) { - getTags().add(tag); + if (tags == null) + tags = new Tags(); + tags.add(tag); return this; } + public boolean hasTag (String tag) { + return tags != null && tags.contains(tag); + } public boolean equals(Object other) { if ( !(other instanceof GLEntry) ) return false; GLEntry castOther = (GLEntry) other;