mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 16:22:06 +01:00
Use StringUtils in SpoilerElement
This commit is contained in:
parent
81f599425a
commit
4292659f22
1 changed files with 3 additions and 4 deletions
|
@ -24,6 +24,7 @@ import java.util.Map;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||||
import org.jivesoftware.smack.packet.Message;
|
import org.jivesoftware.smack.packet.Message;
|
||||||
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||||
|
|
||||||
public class SpoilerElement implements ExtensionElement {
|
public class SpoilerElement implements ExtensionElement {
|
||||||
|
@ -41,10 +42,8 @@ public class SpoilerElement implements ExtensionElement {
|
||||||
* @param hint hint about the content.
|
* @param hint hint about the content.
|
||||||
*/
|
*/
|
||||||
public SpoilerElement(String language, String hint) {
|
public SpoilerElement(String language, String hint) {
|
||||||
if (language != null && !language.equals("")) {
|
if (StringUtils.isNotEmpty(language) && StringUtils.isNullOrEmpty(hint)) {
|
||||||
if (hint == null || hint.equals("")) {
|
throw new IllegalArgumentException("Hint cannot be null or empty if language is not empty.");
|
||||||
throw new IllegalArgumentException("Hint cannot be null or empty if language is not empty.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.language = language;
|
this.language = language;
|
||||||
this.hint = hint;
|
this.hint = hint;
|
||||||
|
|
Loading…
Reference in a new issue