Skip to content

Commit

Permalink
Fix to the package of the MessageContent
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Oct 12, 2020
1 parent 9ed7d72 commit c28936a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main/java/org/luwrain/io/json/MessageContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
General Public License for more details.
*/

package org.luwrain.app.message;
package org.luwrain.io.json;

import java.util.*;
import com.google.gson.*;
Expand All @@ -39,6 +39,10 @@ public final class MessageContent
@SerializedName("attachments")
public List<String> attachments = null;

public MessageContent()
{
}

public MessageContent(String to, String cc, String subject, String[] text)
{
NullCheck.notNull(to, "to");
Expand All @@ -52,6 +56,17 @@ public MessageContent(String to, String cc, String subject, String[] text)
this.attachments = Arrays.asList(new String[0]);
}

public MessageContent(String to, String cc, String subject, String text, String lineSep)
{
this(to, cc, subject, text.split(lineSep, -1));
}

public MessageContent(String to, String cc, String subject, String text)
{
this(to, cc, subject, text, System.lineSeparator());
}


public String[] getTextAsArray()
{
if (text == null)
Expand Down

0 comments on commit c28936a

Please sign in to comment.