0
Ich benutze Dozer-Framework für meine Objekt-Mapping in Java.Verwenden von Dozer-Framework für Objekt-Mapping in Java
Jetzt habe ich aus folgendem Problem stecken:
Im Folgenden sind meine Klassen:
public class BaseQuestion
{
public String question = "";
public String answer = "";
/**
* Getter for question
*/
public String getQuestion()
{
return question;
}
/**
* @Setter for question
*/
public void setQuestion(String question)
{
this.question = question;
}
/**
* Getter for answer
*/
public String getAnswer()
{
return answer;
}
/**
* @Setter for answer
*/
public void setAnswer(String answer)
{
this.answer = answer;
}
}
public class QuestionsMap
{
Question[] question;
public void setQuestion(Question[] question)
{
this.question = question;
}
public Question[] getQuestion()
{
return this.question;
}
}
In the above classes I have to map QuestionsMap class with a HashMap as below:
Map<String,String> questionsMap=new HashMap<String,String>();
BaseQuestion[] question=QuestionsMap.getQuestion();
questionsMap.put(question[0].getQuestion(),question[0].getAnswer());
questionsMap.put(question[1].getQuestion(),question[1].getAnswer());
questionsMap.put(question[2].getQuestion(),question[2].getAnswer());
questionsMap.put(question[3].getQuestion(),question[3].getAnswer());
Kann jemand empfehlen, wie kann ich es acheive Planierraupe Framework.
Danke,
Narendra
Thnaks für Ihre Antwort pgras. Ich möchte Dozer bcz verwenden Ich habe verschiedene Datentypen (wie oben), die zu einer Karte zugeordnet werden müssen. – Narendra