How to create Local Date variable getter?

1

I have a class called Hospede , where I have the getData_entrada() method, which returns a LocalDate variable (new java8 API). However, when I try to capture this method, it always returns me ' null '.

Detail: When I try to catch the other getters it works normally.

//conteudo getData_entrada:

public LocalDate getData_entrada() {

        return data_entrada;
   }



     Hospede hospede = (Hospede) mStrings.get(position);

     textView_nome.setText(hospede.getNome());

     LocalDate data_Entrada = hospede.getData_entrada();
    
asked by anonymous 17.03.2017 / 15:16

1 answer

2

You can set getData_entrada() as follows:

public LocalDate getData_entrada() {
    return LocalDate.now();
}

See the static methods of the public class LocalDate to get the current time:

See more details in the documentation .

    
17.03.2017 / 15:30