Crossfire JXClient, Trunk
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) 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.account;
24 
25 import org.jetbrains.annotations.NotNull;
26 import org.jetbrains.annotations.Nullable;
27 
32 public class CharacterInformation implements Comparable<CharacterInformation> {
33 
37  @NotNull
38  private final String name;
39 
43  @NotNull
44  private final String characterClass;
45 
49  @NotNull
50  private final String race;
51 
55  @NotNull
56  private final String face;
57 
61  @NotNull
62  private final String party;
63 
67  @NotNull
68  private final String map;
69 
73  private final int level;
74 
78  private final int faceNumber;
79 
91  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) {
92  this.name = name;
93  this.characterClass = characterClass;
94  this.race = race;
95  this.face = face;
96  this.party = party;
97  this.map = map;
98  this.level = level;
99  this.faceNumber = faceNumber;
100  }
101 
106  @NotNull
107  public String getName() {
108  return name;
109  }
110 
115  @NotNull
116  public String getCharacterClass() {
117  return characterClass;
118  }
119 
124  @NotNull
125  public String getRace() {
126  return race;
127  }
128 
133  @NotNull
134  public String getFace() {
135  return face;
136  }
137 
142  @NotNull
143  public String getParty() {
144  return party;
145  }
146 
151  @NotNull
152  public String getMap() {
153  return map;
154  }
155 
160  public int getLevel() {
161  return level;
162  }
163 
168  public int getFaceNumber() {
169  return faceNumber;
170  }
171 
172  @Override
173  public int compareTo(@NotNull final CharacterInformation o) {
174  return name.compareTo(o.name);
175  }
176 
177  @Override
178  public int hashCode() {
179  return name.hashCode();
180  }
181 
182  @Override
183  public boolean equals(@Nullable final Object obj) {
184  if (!(obj instanceof CharacterInformation)) {
185  return false;
186  }
187 
188  final CharacterInformation characterInformation = (CharacterInformation)obj;
189  return characterInformation.name.equals(name);
190  }
191 
192  @NotNull
193  @Override
194  public String toString() {
195  return "name="+name+", class="+characterClass+", race="+race+", face="+faceNumber+"/"+face+", party="+party+", map="+map+", level="+level;
196  }
197 
198 }
com.realtime.crossfire.jxclient.account.CharacterInformation.name
final String name
Definition: CharacterInformation.java:38
com.realtime.crossfire.jxclient.account.CharacterInformation.face
final String face
Definition: CharacterInformation.java:56
com.realtime.crossfire.jxclient.account.CharacterInformation.getName
String getName()
Definition: CharacterInformation.java:107
com.realtime.crossfire.jxclient.account.CharacterInformation.getRace
String getRace()
Definition: CharacterInformation.java:125
com.realtime.crossfire.jxclient.account.CharacterInformation.getParty
String getParty()
Definition: CharacterInformation.java:143
com.realtime.crossfire.jxclient.account.CharacterInformation
Definition: CharacterInformation.java:32
com.realtime.crossfire.jxclient.account.CharacterInformation.equals
boolean equals(@Nullable final Object obj)
Definition: CharacterInformation.java:183
com.realtime.crossfire.jxclient.account.CharacterInformation.level
final int level
Definition: CharacterInformation.java:73
com.realtime.crossfire.jxclient.account.CharacterInformation.toString
String toString()
Definition: CharacterInformation.java:194
com.realtime.crossfire.jxclient.account.CharacterInformation.race
final String race
Definition: CharacterInformation.java:50
com.realtime.crossfire.jxclient.account.CharacterInformation.hashCode
int hashCode()
Definition: CharacterInformation.java:178
com.realtime.crossfire.jxclient.account.CharacterInformation.CharacterInformation
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)
Definition: CharacterInformation.java:91
com.realtime.crossfire.jxclient.account.CharacterInformation.party
final String party
Definition: CharacterInformation.java:62
com.realtime.crossfire.jxclient.account.CharacterInformation.compareTo
int compareTo(@NotNull final CharacterInformation o)
Definition: CharacterInformation.java:173
com.realtime.crossfire.jxclient.account.CharacterInformation.getFaceNumber
int getFaceNumber()
Definition: CharacterInformation.java:168
com.realtime.crossfire.jxclient.account.CharacterInformation.getLevel
int getLevel()
Definition: CharacterInformation.java:160
com.realtime.crossfire.jxclient.account.CharacterInformation.map
final String map
Definition: CharacterInformation.java:68
com.realtime.crossfire.jxclient.account.CharacterInformation.getCharacterClass
String getCharacterClass()
Definition: CharacterInformation.java:116
com.realtime.crossfire.jxclient.account.CharacterInformation.getMap
String getMap()
Definition: CharacterInformation.java:152
com.realtime.crossfire.jxclient.account.CharacterInformation.faceNumber
final int faceNumber
Definition: CharacterInformation.java:78
com.realtime.crossfire.jxclient.account.CharacterInformation.characterClass
final String characterClass
Definition: CharacterInformation.java:44
com.realtime.crossfire.jxclient.account.CharacterInformation.getFace
String getFace()
Definition: CharacterInformation.java:134