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

Deprecate some chat2 ChatManager APIs

because their functional interfaces clashes. This helps to prepare
Smack for Java 8 where such a construct results in a compile time error.
This commit is contained in:
Florian Schmaus 2018-02-10 12:08:40 +01:00
parent 6dfc20ee5e
commit 278c15d52d

View file

@ -218,12 +218,24 @@ public final class ChatManager extends Manager {
* *
* @param listener the listener to remove. * @param listener the listener to remove.
* @return <code>true</code> if the listener was active and got removed. * @return <code>true</code> if the listener was active and got removed.
* @deprecated Use {@link #removeIncomingListener(IncomingChatMessageListener)} instead.
*/ */
@Deprecated
@SuppressWarnings("FunctionalInterfaceClash") @SuppressWarnings("FunctionalInterfaceClash")
public boolean removeListener(IncomingChatMessageListener listener) { public boolean removeListener(IncomingChatMessageListener listener) {
return incomingListeners.remove(listener); return incomingListeners.remove(listener);
} }
/**
* Remove an incoming chat message listener.
*
* @param listener the listener to remove.
* @return <code>true</code> if the listener was active and got removed.
*/
public boolean removeIncomingListener(IncomingChatMessageListener listener) {
return incomingListeners.remove(listener);
}
/** /**
* Add a new listener for outgoing chat messages. * Add a new listener for outgoing chat messages.
* *
@ -252,9 +264,11 @@ public final class ChatManager extends Manager {
* *
* @param listener the listener to remove. * @param listener the listener to remove.
* @return <code>true</code> if the listener was active and got removed. * @return <code>true</code> if the listener was active and got removed.
* @deprecated use {@link #removeOutgoingListener(OutgoingChatMessageListener)} instead.
*/ */
@Deprecated
public boolean removeListener(OutgoingChatMessageListener listener) { public boolean removeListener(OutgoingChatMessageListener listener) {
return outgoingListeners.remove(listener); return removeOutgoingListener(listener);
} }
/** /**
@ -262,11 +276,9 @@ public final class ChatManager extends Manager {
* *
* @param listener the listener to remove. * @param listener the listener to remove.
* @return <code>true</code> if the listener was active and got removed. * @return <code>true</code> if the listener was active and got removed.
* @deprecated use {@link #removeListener(OutgoingChatMessageListener)} instead.
*/ */
@Deprecated public boolean removeOutgoingListener(OutgoingChatMessageListener listener) {
public boolean removeOutoingLIstener(OutgoingChatMessageListener listener) { return outgoingListeners.remove(listener);
return removeListener(listener);
} }
/** /**