forked from xxDark/JavaShellcodeInjector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathField.java
More file actions
32 lines (28 loc) · 854 Bytes
/
Field.java
File metadata and controls
32 lines (28 loc) · 854 Bytes
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
package one.helfy;
public final class Field implements Comparable<Field> {
public final String name;
public final String typeName;
public final long offset;
public final boolean isStatic;
Field(String name, String typeName, long offset, boolean isStatic) {
this.name = name;
this.typeName = typeName;
this.offset = offset;
this.isStatic = isStatic;
}
@Override
public int compareTo(Field o) {
if (isStatic != o.isStatic) {
return isStatic ? -1 : 1;
}
return Long.compare(offset, o.offset);
}
@Override
public String toString() {
if (isStatic) {
return "static " + typeName + ' ' + name + " @ 0x" + Long.toHexString(offset);
} else {
return typeName + ' ' + name + " @ " + offset;
}
}
}