Address should have Extensions
Issue #70
closed
Hi,
XEP-0033 in sections 4.7 allows for extensions (child elements) of the Address element unfortunately the class is final so I can not extend this myself. Making it non-final would be an easy solution but adding the addExension/hasExtension/getExtension methods from stanza might be a better one.
I'm pretty new to this library (looking good so far by the way. Thank you!) so I'm unsure if there is a better approach. Would you accept a patch that adds those three methods mentioned above?
Comments (3)
-
repo owner -
repo owner - changed status to resolved
XEP-0033: Address should have extensions
As per Section 4.7.
Fixes issue
#70.→ <<cset 6421cd93361b>>
-
repo owner - changed status to closed
Resolved with version 0.7.0
- Log in to comment
Oh, you are right. At the moment all extensions like
Address
are immutable and actually I would like to keep that pattern for the sake of consistency at least.What do you think about the following?
Collection<Object>
, addAll to a privateList<Object>
List<Object> getExtensions()
returning an unmodifiable list.<T> T getExtension(Class<T> clazz)
(as in Stanza class)addExtension
would make it mutable. Probably harmless, it's just that I prefer immutable classes.Sure, you can do a PR!
Btw.: How did you recognize the lack of the extension? Afaik most servers don't even support XEP-0033 and surely not custom extensions. It's lacking in the XML schema, too, that's why I've overlooked it.