1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Use ParserUtils.parseXmlBoolean() where appropriate

This commit is contained in:
Florian Schmaus 2018-11-29 22:29:21 +01:00
parent 7ea7f9e2e9
commit dbfc123e5e
2 changed files with 9 additions and 5 deletions

View file

@ -16,6 +16,8 @@
*/
package org.jivesoftware.smackx.hoxt.provider;
import org.jivesoftware.smack.util.ParserUtils;
import org.jivesoftware.smackx.hoxt.packet.HttpMethod;
import org.jivesoftware.smackx.hoxt.packet.HttpOverXmppReq;
@ -47,13 +49,13 @@ public class HttpOverXmppReqProvider extends AbstractHttpOverXmppProvider<HttpOv
String jingleStr = parser.getAttributeValue("", AbstractHttpOverXmppProvider.ELEMENT_JINGLE);
if (sipubStr != null) {
builder.setSipub(Boolean.valueOf(sipubStr));
builder.setSipub(ParserUtils.parseXmlBoolean(sipubStr));
}
if (ibbStr != null) {
builder.setIbb(Boolean.valueOf(ibbStr));
builder.setIbb(ParserUtils.parseXmlBoolean(ibbStr));
}
if (jingleStr != null) {
builder.setJingle(Boolean.valueOf(jingleStr));
builder.setJingle(ParserUtils.parseXmlBoolean(jingleStr));
}
String maxChunkSize = parser.getAttributeValue("", ATTRIBUTE_MAX_CHUNK_SIZE);

View file

@ -1,6 +1,6 @@
/**
*
* Copyright © 2016 Florian Schmaus
* Copyright © 2016-2018 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,6 +16,8 @@
*/
package org.jivesoftware.smackx.iot.control.element;
import org.jivesoftware.smack.util.ParserUtils;
public class SetBoolData extends SetData {
public SetBoolData(String name, boolean value) {
@ -31,7 +33,7 @@ public class SetBoolData extends SetData {
public Boolean getBooleanValue() {
if (booleanCache != null) {
booleanCache = Boolean.valueOf(getValue());
booleanCache = ParserUtils.parseXmlBoolean(getValue());
}
return booleanCache;
}