Added warning to Labeler for developers who want to implement it.

This commit is contained in:
Christian Basler 2016-05-06 17:29:39 +02:00
parent 4f0b2cb8f8
commit de8f04e22a

View File

@ -20,6 +20,8 @@ import ch.dissem.bitmessage.entity.Plaintext;
/** /**
* Defines and sets labels. Note that it should also update the status field of a message. * Defines and sets labels. Note that it should also update the status field of a message.
* Generally it's highly advised to override the {@link DefaultLabeler} whenever possible,
* instead of directly implementing the interface.
* <p> * <p>
* As the labeler gets called whenever the state of a message changes, it can also be used * As the labeler gets called whenever the state of a message changes, it can also be used
* as a listener. * as a listener.
@ -35,6 +37,10 @@ public interface Labeler {
void markAsDraft(Plaintext msg); void markAsDraft(Plaintext msg);
/**
* It is paramount that this methods marks the {@link Plaintext} object with status
* {@link Plaintext.Status#PUBKEY_REQUESTED} (see {@link DefaultLabeler})
*/
void markAsSending(Plaintext msg); void markAsSending(Plaintext msg);
void markAsSent(Plaintext msg); void markAsSent(Plaintext msg);