Crossfire JXClient, Trunk
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-2017,2019-2023 Andreas Kirschbaum
20  * Copyright (C) 2010-2012,2014-2018,2020-2023 Nicolas Weeger
21  */
22 
23 package com.realtime.crossfire.jxclient.character;
24 
25 import java.util.Collections;
26 import java.util.LinkedHashMap;
27 import java.util.Map;
28 import org.jetbrains.annotations.NotNull;
29 
34 public class Choice {
35 
39  @NotNull
40  private final String choiceName;
41 
45  @NotNull
46  private final String choiceDescription;
47 
51  @NotNull
52  private final Map<String, String> choices;
53 
60  public Choice(@NotNull final String choiceName, @NotNull final String choiceDescription, @NotNull final Map<String, String> choices) {
61  this.choiceName = choiceName;
62  this.choiceDescription = choiceDescription;
63  this.choices = new LinkedHashMap<>(choices);
64  }
65 
70  @NotNull
71  public String getChoiceName() {
72  return choiceName;
73  }
74 
79  @NotNull
80  public String getChoiceDescription() {
81  return choiceDescription;
82  }
83 
88  @NotNull
89  public Map<String, String> getChoices() {
90  return Collections.unmodifiableMap(choices);
91  }
92 
93  @NotNull
94  @Override
95  public String toString() {
96  return "name="+choiceName+", description="+choiceDescription+", choices="+choices;
97  }
98 
99 }
com.realtime.crossfire.jxclient.character.Choice.Choice
Choice(@NotNull final String choiceName, @NotNull final String choiceDescription, @NotNull final Map< String, String > choices)
Definition: Choice.java:60
com.realtime.crossfire.jxclient.character.Choice
Definition: Choice.java:34
com.realtime.crossfire.jxclient.character.Choice.choiceDescription
final String choiceDescription
Definition: Choice.java:46
com.realtime.crossfire.jxclient.character.Choice.getChoices
Map< String, String > getChoices()
Definition: Choice.java:89
com.realtime.crossfire.jxclient.character.Choice.choices
final Map< String, String > choices
Definition: Choice.java:52
com.realtime.crossfire.jxclient.character.Choice.toString
String toString()
Definition: Choice.java:95
com.realtime.crossfire.jxclient.character.Choice.getChoiceDescription
String getChoiceDescription()
Definition: Choice.java:80
com.realtime.crossfire.jxclient.character.Choice.getChoiceName
String getChoiceName()
Definition: Choice.java:71
com.realtime.crossfire.jxclient.character.Choice.choiceName
final String choiceName
Definition: Choice.java:40