Crossfire JXClient, Trunk  R20561
Choice.java
Go to the documentation of this file.
1 /*
2  * This file is part of JXClient, the Fullscreen Java Crossfire Client.
3  *
4  * JXClient is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * JXClient is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with JXClient; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Copyright (C) 2005-2008 Yann Chachkoff.
19  * Copyright (C) 2006-2011 Andreas Kirschbaum.
20  */
21 
22 package com.realtime.crossfire.jxclient.character;
23 
24 import java.util.Collections;
25 import java.util.LinkedHashMap;
26 import java.util.Map;
27 import org.jetbrains.annotations.NotNull;
28 
33 public class Choice {
34 
38  @NotNull
39  private final String choiceName;
40 
44  @NotNull
45  private final String choiceDescription;
46 
50  @NotNull
51  private final Map<String, String> choices;
52 
59  public Choice(@NotNull final String choiceName, @NotNull final String choiceDescription, @NotNull final Map<String, String> choices) {
60  this.choiceName = choiceName;
61  this.choiceDescription = choiceDescription;
62  this.choices = new LinkedHashMap<>(choices);
63  }
64 
69  @NotNull
70  public String getChoiceName() {
71  return choiceName;
72  }
73 
78  @NotNull
79  public String getChoiceDescription() {
80  return choiceDescription;
81  }
82 
87  @NotNull
88  public Map<String, String> getChoices() {
89  return Collections.unmodifiableMap(choices);
90  }
91 
95  @NotNull
96  @Override
97  public String toString() {
98  return "name="+choiceName+", description="+choiceDescription+", choices="+choices;
99  }
100 
101 }
final String choiceName
Identifies the choice.
Definition: Choice.java:39
Choice(@NotNull final String choiceName, @NotNull final String choiceDescription, @NotNull final Map< String, String > choices)
Creates a new instance.
Definition: Choice.java:59
final String choiceDescription
The human readable choice name.
Definition: Choice.java:45
Map< String, String > getChoices()
Returns the choices.
Definition: Choice.java:88
A choice for character creation.
Definition: Choice.java:33
String getChoiceDescription()
Returns the human readable choice name.
Definition: Choice.java:79
String getChoiceName()
Returns the choice identification.
Definition: Choice.java:70
final Map< String, String > choices
The choices.
Definition: Choice.java:51