1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +01:00

[core] Add convenience constructor to AbstractStreamOpen

Most of the times when we construct a stream-open-like element, we
want the jabber:client namespace. Hence add a constructor that does
select the namespace implicitly.
This commit is contained in:
Florian Schmaus 2020-08-26 11:36:55 +02:00
parent 2a9671ca93
commit e6a60213b6

View file

@ -1,6 +1,6 @@
/** /**
* *
* Copyright 2020 Aditya Borikar * Copyright 2020 Florian Schmaus, Aditya Borikar
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -60,6 +60,10 @@ public abstract class AbstractStreamOpen implements Nonza {
*/ */
protected final String contentNamespace; protected final String contentNamespace;
public AbstractStreamOpen(CharSequence to, CharSequence from, String id, String lang) {
this(to, from, id, lang, StreamContentNamespace.client);
}
public AbstractStreamOpen(CharSequence to, CharSequence from, String id, String lang, StreamContentNamespace ns) { public AbstractStreamOpen(CharSequence to, CharSequence from, String id, String lang, StreamContentNamespace ns) {
this.to = StringUtils.maybeToString(to); this.to = StringUtils.maybeToString(to);
this.from = StringUtils.maybeToString(from); this.from = StringUtils.maybeToString(from);