/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.lagunex.twitter;

import java.util.Date;
import twitter4j.Status;

/**
 *
 * @author carloshq
 */
public class Tweet {
    private static final char RESERVED_CHAR = '|';
    private static final char RESERVED_CHAR_REPLACEMENT = ' ';
    
    private final long id;
    private final String message;
    private final Date createdAt;
    private final String language;

    public Tweet(Status s) {
	    id = s.getId();
        message = s.getText().replace(RESERVED_CHAR, RESERVED_CHAR_REPLACEMENT);
        language = s.getLang();
        createdAt = s.getCreatedAt();
    }
    
    public String toTblString() {
        return toString().replace('\n', ' ');
    }
    
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getId()).append(RESERVED_CHAR)
          .append(getMessage()).append(RESERVED_CHAR)
          .append(getLanguage()).append(RESERVED_CHAR)
          .append(getCreatedAt());
        return sb.toString();
    }
    
    public long getId() {
        return id;
    }

    public String getMessage() {
        return message;
    }
    
    public String getLanguage() {
        return language;
    }

    public Date getCreatedAt() {
        return createdAt;
    }
}

@@ -224,17 +224,55 @@
 ava.
-u
 ti
-l.Date
+me.LocalDateTime;%0Aimport java.time.ZoneOffset
 ;%0Aim
@@ -545,19 +545,28 @@
 e final 
-Dat
+LocalDateTim
 e create
@@ -793,114 +793,75 @@
 t = 
-s.getCreatedAt();%0A    %7D%0A    %0A    public String toTblString() %7B%0A        return toString().replace('%5Cn', ' '
+LocalDateTime.ofInstant(s.getCreatedAt().toInstant(),ZoneOffset.UTC
 );%0A 
@@ -1180,24 +1180,43 @@
 b.toString()
+.replace('%5Cn', ' ')
 ;%0A    %7D%0A    
@@ -1413,19 +1413,28 @@
  public 
-Dat
+LocalDateTim
 e getCre

remove toStringTbl() and change createdAt type