Crossfire JXClient, Trunk  R20561
CharacterInformation.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) 2010 Nicolas Weeger.
19  */
20 
21 package com.realtime.crossfire.jxclient.account;
22 
23 import org.jetbrains.annotations.NotNull;
24 import org.jetbrains.annotations.Nullable;
25 
30 public class CharacterInformation implements Comparable<CharacterInformation> {
31 
35  @NotNull
36  private final String name;
37 
41  @NotNull
42  private final String characterClass;
43 
47  @NotNull
48  private final String race;
49 
53  @NotNull
54  private final String face;
55 
59  @NotNull
60  private final String party;
61 
65  @NotNull
66  private final String map;
67 
71  private final int level;
72 
76  private final int faceNumber;
77 
89  public CharacterInformation(@NotNull final String name, @NotNull final String characterClass, @NotNull final String race, @NotNull final String face, @NotNull final String party, @NotNull final String map, final int level, final int faceNumber) {
90  this.name = name;
91  this.characterClass = characterClass;
92  this.race = race;
93  this.face = face;
94  this.party = party;
95  this.map = map;
96  this.level = level;
97  this.faceNumber = faceNumber;
98  }
99 
104  @NotNull
105  public String getName() {
106  return name;
107  }
108 
113  @NotNull
114  public String getCharacterClass() {
115  return characterClass;
116  }
117 
122  @NotNull
123  public String getRace() {
124  return race;
125  }
126 
131  @NotNull
132  public String getFace() {
133  return face;
134  }
135 
140  @NotNull
141  public String getParty() {
142  return party;
143  }
144 
149  @NotNull
150  public String getMap() {
151  return map;
152  }
153 
158  public int getLevel() {
159  return level;
160  }
161 
166  public int getFaceNumber() {
167  return faceNumber;
168  }
169 
173  @Override
174  public int compareTo(@NotNull final CharacterInformation o) {
175  return name.compareTo(o.name);
176  }
177 
181  @Override
182  public int hashCode() {
183  return name.hashCode();
184  }
185 
189  @Override
190  public boolean equals(@Nullable final Object obj) {
191  if (!(obj instanceof CharacterInformation)) {
192  return false;
193  }
194 
195  final CharacterInformation characterInformation = (CharacterInformation)obj;
196  return characterInformation.name.equals(name);
197  }
198 
202  @NotNull
203  @Override
204  public String toString() {
205  return "name="+name+", class="+characterClass+", race="+race+", face="+faceNumber+"/"+face+", party="+party+", map="+map+", level="+level;
206  }
207 
208 }
String getCharacterClass()
Returns the character&#39;s class.
CharacterInformation(@NotNull final String name, @NotNull final String characterClass, @NotNull final String race, @NotNull final String face, @NotNull final String party, @NotNull final String map, final int level, final int faceNumber)
Creates a new instance.
int getFaceNumber()
Returns the character&#39;s face number.