Tweet.java 1.16 KB
Newer Older
willgonzz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
import java.util.ArrayList;

public class Tweet{
    private int tweet_id;
    private String texto;
    private int nroLikes;
    private int nroRtw;
    private ArrayList<String> comentarios;
    
    public Tweet(int tweet_id, String texto, int nroLikes, Usuario U) {
        this.tweet_id = tweet_id;
        this.texto = texto;
        this.nroLikes = nroLikes;
    }
    public void setComentarios(String comentario){
        comentarios.add(comentario);
    }
    public int getTweet_id() {
        return this.tweet_id;
    }
    
    public void setTweet_id(int tweet_id) {
        this.tweet_id = tweet_id;
    }
    
    public String getTexto() {
        return this.texto;
    }

    public void setTexto(String texto) {
        this.texto = texto;
    }
    
    public int getNroLikes() {
        return this.nroLikes;
    }
    
    public void setNroLikes() {
        this.nroLikes++;
    }

    public int getNroRtw() {
        return this.nroRtw;
    }
    
    public void setNroRtw() {
        this.nroRtw++;
    }
    public void verComentario(){
        for(String comentario: this.comentarios){
            System.out.println(comentario);
        }
    }
    
}