-1

Hello i m searching for solution to how see the valus exists at my list , code :

public Iterable<RfpActiveObject> getactive(){
    List<Rfxobject> rx =     rfx.findAll();
    List<Rfpobject> rp = rfp.findAll();

    Long compteurRfx =rfp.count();
    Long CompteurRfp= rfx.count();
    long TabMax = compteurRfx+CompteurRfp;
    List<Object> newList = new ArrayList<Object>();
    newList.add(rx);
    newList.add(rp);
    for(int i =0 ; i<  TabMax ; i++) {
        RfpActiveObject rf =  new RfpActiveObject();
        System.out.println("**** Liste "+i+"  :");
        System.out.println(newList.get(0));
        System.out.println("**** *****************");
     }
}

The input to my list is :

**** Liste 13  :
[com.pfe.backend.models.Rfxobject@2767bc, com.pfe.backend.models.Rfxobject@2389804e, com.pfe.backend.models.Rfxobject@31eda7ed, com.pfe.backend.models.Rfxobject@5ba91ebd, com.pfe.backend.models.Rfxobject@600898f3, com.pfe.backend.models.Rfxobject@fecef4c]
**** *****************

I need to get the real value not adress please what i should to do

azro
  • 53,056
  • 7
  • 34
  • 70

1 Answers1

1

You have to overwrite the toString() method inside both of your classes - Rfxobject and Rfpobject.

More details

aliench0
  • 109
  • 1
  • 8
  • @GetMapping("/active") public Iterable getactive(){ List rx = rfx.findAll(); List rp = rfp.findAll(); Long compteurRfx =rfp.count(); Long CompteurRfp= rfx.count(); long TabMax = compteurRfx+CompteurRfp; List newList = new ArrayList(); newList.add(rx); newList.add(rp); Iterator ii = newList.iterator(); while (ii.hasNext()) { System.out.println(ii.next());}return null;} – ELMANDPURAMINE Jun 01 '20 at 09:33
  • but i have already the same input please what i should to do – ELMANDPURAMINE Jun 01 '20 at 09:34
  • @Override public String toString() { return getClass().getName() + "@" + Integer.toHexString(hashCode()); } – ELMANDPURAMINE Jun 01 '20 at 09:40