diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-11-19 23:07:54 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-11-19 23:07:54 +0100 |
commit | d783cec97084a12873ca62b5fcd64620056ec01b (patch) | |
tree | 65e63d03dd4ab7a834c343ba593c8cd8917620cb /src/main/java/de/pixart/messenger/xmpp/forms/Field.java | |
parent | 969ba45c56adaaa056f04464cd98aec115c9611b (diff) |
reformat code
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/forms/Field.java | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/forms/Field.java b/src/main/java/de/pixart/messenger/xmpp/forms/Field.java index 4cf5fc6b7..a05f9538e 100644 --- a/src/main/java/de/pixart/messenger/xmpp/forms/Field.java +++ b/src/main/java/de/pixart/messenger/xmpp/forms/Field.java @@ -9,73 +9,73 @@ import de.pixart.messenger.xml.Element; public class Field extends Element { - public Field(String name) { - super("field"); - this.setAttribute("var",name); - } + public Field(String name) { + super("field"); + this.setAttribute("var", name); + } - private Field() { - super("field"); - } + private Field() { + super("field"); + } - public String getFieldName() { - return this.getAttribute("var"); - } + public String getFieldName() { + return this.getAttribute("var"); + } - public void setValue(String value) { - this.children.clear(); - this.addChild("value").setContent(value); - } + public void setValue(String value) { + this.children.clear(); + this.addChild("value").setContent(value); + } - public void setValues(Collection<String> values) { - this.children.clear(); - for(String value : values) { - this.addChild("value").setContent(value); - } - } + public void setValues(Collection<String> values) { + this.children.clear(); + for (String value : values) { + this.addChild("value").setContent(value); + } + } - public void removeNonValueChildren() { - for(Iterator<Element> iterator = this.children.iterator(); iterator.hasNext();) { - Element element = iterator.next(); - if (!element.getName().equals("value")) { - iterator.remove(); - } - } - } + public void removeNonValueChildren() { + for (Iterator<Element> iterator = this.children.iterator(); iterator.hasNext(); ) { + Element element = iterator.next(); + if (!element.getName().equals("value")) { + iterator.remove(); + } + } + } - public static Field parse(Element element) { - Field field = new Field(); - field.setAttributes(element.getAttributes()); - field.setChildren(element.getChildren()); - return field; - } + public static Field parse(Element element) { + Field field = new Field(); + field.setAttributes(element.getAttributes()); + field.setChildren(element.getChildren()); + return field; + } - public String getValue() { - return findChildContent("value"); - } + public String getValue() { + return findChildContent("value"); + } - public List<String> getValues() { - List<String> values = new ArrayList<>(); - for(Element child : getChildren()) { - if ("value".equals(child.getName())) { - String content = child.getContent(); - if (content != null) { - values.add(content); - } - } - } - return values; - } + public List<String> getValues() { + List<String> values = new ArrayList<>(); + for (Element child : getChildren()) { + if ("value".equals(child.getName())) { + String content = child.getContent(); + if (content != null) { + values.add(content); + } + } + } + return values; + } - public String getLabel() { - return getAttribute("label"); - } + public String getLabel() { + return getAttribute("label"); + } - public String getType() { - return getAttribute("type"); - } + public String getType() { + return getAttribute("type"); + } - public boolean isRequired() { - return hasChild("required"); - } + public boolean isRequired() { + return hasChild("required"); + } } |