/** * Creates a new message. * * @return a <tt>MessageBuildSubject</tt> which essentially is a <tt>Message</tt>, but ensures that the user * constructs messages properly */ @SuppressWarnings({ "unchecked" }) public static MessageBuildSubject<MessageBuildSendableWithReply> createMessage() { return new DefaultMessageBuilder(provider.get()).start(); }
/** * Creates a new message for the provided subject. * * @param subject * the subject the message should be sent to * @return a <tt>MessageBuildSubject</tt> which essentially is a <tt>Message</tt>, but ensures that the user * constructs messages properly */ @SuppressWarnings({ "unchecked" }) public static MessageBuildCommand<MessageBuildSendableWithReply> createMessage(final String subject) { return new DefaultMessageBuilder(provider.get()).start().toSubject(subject); }
/** * Creates a conversational message. * * @param message * reference message to create conversation from * @return a <tt>MessageBuildSubject</tt> which essentially is a <tt>Message</tt>, but ensures that the user * constructs messages properly */ public static MessageBuildSubject<MessageReplySendable> createConversation(final Message message) { final Message newMessage = provider.get(); newMessage.setFlag(RoutingFlag.NonGlobalRouting); if (newMessage instanceof HasEncoded) { return new DefaultMessageBuilder<MessageReplySendable>(new HasEncodedConvMessageWrapper(message, newMessage)) .start(); } else { return new DefaultMessageBuilder<MessageReplySendable>(new ConversationMessageWrapper(message, newMessage)) .start(); } }
/** * Creates a conversational message for the provided subject. * * @param message * reference message to create conversation from * @param subject * the subject the message should be sent to * @return a <tt>MessageBuildSubject</tt> which essentially is a <tt>Message</tt>, but ensures that the user * constructs messages properly */ public static MessageBuildCommand<MessageReplySendable> createConversation(final Message message, final String subject) { final Message newMessage = provider.get(); if (newMessage instanceof HasEncoded) { return new DefaultMessageBuilder<MessageReplySendable>(new HasEncodedConvMessageWrapper(message, newMessage)) .start() .toSubject(subject); } else { return new DefaultMessageBuilder<MessageReplySendable>(new ConversationMessageWrapper(message, newMessage)) .start() .toSubject(subject); } }
/** * Creates a new message. * * @return a <tt>MessageBuildSubject</tt> which essentially is a <tt>Message</tt>, but ensures that the user * constructs messages properly */ @SuppressWarnings({ "unchecked" }) public static MessageBuildSubject<MessageBuildSendableWithReply> createMessage() { return new DefaultMessageBuilder(provider.get()).start(); }
/** * Creates a new message for the provided subject. * * @param subject * the subject the message should be sent to * @return a <tt>MessageBuildSubject</tt> which essentially is a <tt>Message</tt>, but ensures that the user * constructs messages properly */ @SuppressWarnings({ "unchecked" }) public static MessageBuildCommand<MessageBuildSendableWithReply> createMessage(final String subject) { return new DefaultMessageBuilder(provider.get()).start().toSubject(subject); }
/** * Creates a conversational message. * * @param message * reference message to create conversation from * @return a <tt>MessageBuildSubject</tt> which essentially is a <tt>Message</tt>, but ensures that the user * constructs messages properly */ public static MessageBuildSubject<MessageReplySendable> createConversation(final Message message) { final Message newMessage = provider.get(); newMessage.setFlag(RoutingFlag.NonGlobalRouting); if (newMessage instanceof HasEncoded) { return new DefaultMessageBuilder<MessageReplySendable>(new HasEncodedConvMessageWrapper(message, newMessage)) .start(); } else { return new DefaultMessageBuilder<MessageReplySendable>(new ConversationMessageWrapper(message, newMessage)) .start(); } }
/** * Creates a conversational message for the provided subject. * * @param message * reference message to create conversation from * @param subject * the subject the message should be sent to * @return a <tt>MessageBuildSubject</tt> which essentially is a <tt>Message</tt>, but ensures that the user * constructs messages properly */ public static MessageBuildCommand<MessageReplySendable> createConversation(final Message message, final String subject) { final Message newMessage = provider.get(); if (newMessage instanceof HasEncoded) { return new DefaultMessageBuilder<MessageReplySendable>(new HasEncodedConvMessageWrapper(message, newMessage)) .start() .toSubject(subject); } else { return new DefaultMessageBuilder<MessageReplySendable>(new ConversationMessageWrapper(message, newMessage)) .start() .toSubject(subject); } }