mercredi 25 janvier 2017

Fill a complex Java Object with dummy values

If A, B, C, D are classes. Suppose a class A is structured as below.

    class A{
    private List<B> bList;
    private String name;
    private boolean dude;
    private C c;
    private D d;
    //Getter and Setter Methods
    }

B , C and D have some properties like String, boolean etc. say

class B{
private String e;
private boolean b;
.....
//Getter and Setter Methods
}

Now I want to create an object of A with its property B, C and D not being null but filled with Dummy values say "abc" for String, 1 for int , false for boolean.

So the aim is to create an object A with dummy values. How can this be achieved ?





Aucun commentaire:

Enregistrer un commentaire