blob: 0968e955d98cdfd6c4b21be7d08cd81820d31441 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
/*******************************************************************************
* Copyright (c) 2014 Jeff Martin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Jeff Martin - initial API and implementation
******************************************************************************/
package cuchaz.enigma.mapping;
import java.io.Serializable;
public class ClassEntry implements Entry, Serializable
{
private static final long serialVersionUID = 4235460580973955811L;
private String m_name;
public ClassEntry( String className )
{
if( className == null )
{
throw new IllegalArgumentException( "Class name cannot be null!" );
}
if( className.contains( "." ) )
{
throw new IllegalArgumentException( "Class name must be in JVM format. ie, path/to/package/class$inner" );
}
m_name = className;
}
public ClassEntry( ClassEntry other )
{
m_name = other.m_name;
}
@Override
public String getName( )
{
return m_name;
}
@Override
public int hashCode( )
{
return m_name.hashCode();
}
@Override
public boolean equals( Object other )
{
if( other instanceof ClassEntry )
{
return equals( (ClassEntry)other );
}
return false;
}
public boolean equals( ClassEntry other )
{
return m_name.equals( other.m_name );
}
@Override
public String toString( )
{
return m_name;
}
}
|