Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

Commit abf2f04

Browse files
committed
Getters
1 parent ddbfaef commit abf2f04

File tree

9 files changed

+44
-0
lines changed

9 files changed

+44
-0
lines changed

src/main/java/io/github/seggan/javaclasslib/constantpool/ClassEntry.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ public ClassEntry(List<ConstantPoolEntry> constantPool, UTF8Entry name) {
1919
public byte[] getBytes() {
2020
return Bytes.concat(getTag().getByte(), name.getIndexBytes());
2121
}
22+
23+
public UTF8Entry getName() {
24+
return name;
25+
}
2226
}

src/main/java/io/github/seggan/javaclasslib/constantpool/NameAndTypeEntry.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,12 @@ public NameAndTypeEntry(List<ConstantPoolEntry> constantPool, UTF8Entry name, UT
2121
public byte[] getBytes() {
2222
return Bytes.concat(getTag().getByte(), name.getIndexBytes(), descriptor.getIndexBytes());
2323
}
24+
25+
public UTF8Entry getName() {
26+
return name;
27+
}
28+
29+
public UTF8Entry getDescriptor() {
30+
return descriptor;
31+
}
2432
}

src/main/java/io/github/seggan/javaclasslib/constantpool/UTF8Entry.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ public UTF8Entry(List<ConstantPoolEntry> constantPool, String s) {
2525
public byte[] getBytes() {
2626
return Bytes.concat(getTag().getByte(), ByteUtils.twoBytesFromInt(data.length), data);
2727
}
28+
29+
public byte[] getData() {
30+
return data;
31+
}
2832
}

src/main/java/io/github/seggan/javaclasslib/constantpool/classmembers/ClassMemberEntry.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@ public ClassMemberEntry(List<ConstantPoolEntry> constantPool, ConstantPoolTag ke
2525
public final byte[] getBytes() {
2626
return Bytes.concat(getTag().getByte(), clazz.getIndexBytes(), nameAndType.getIndexBytes());
2727
}
28+
29+
public ClassEntry getClassEntry() {
30+
return clazz;
31+
}
32+
33+
public NameAndTypeEntry getNameAndType() {
34+
return nameAndType;
35+
}
2836
}

src/main/java/io/github/seggan/javaclasslib/constantpool/types/DoubleEntry.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ public DoubleEntry(List<ConstantPoolEntry> constantPool, double value) {
2222
public byte[] getBytes() {
2323
return Bytes.concat(getTag().getByte(), ByteUtils.doubleToBytes(value));
2424
}
25+
26+
public double getValue() {
27+
return value;
28+
}
2529
}

src/main/java/io/github/seggan/javaclasslib/constantpool/types/FloatEntry.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ public FloatEntry(List<ConstantPoolEntry> constantPool, float value) {
2222
public byte[] getBytes() {
2323
return Bytes.concat(getTag().getByte(), ByteUtils.floatToBytes(value));
2424
}
25+
26+
public float getValue() {
27+
return value;
28+
}
2529
}

src/main/java/io/github/seggan/javaclasslib/constantpool/types/IntegerEntry.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ public IntegerEntry(List<ConstantPoolEntry> constantPool, int value) {
2222
public byte[] getBytes() {
2323
return Bytes.concat(getTag().getByte(), ByteUtils.intToBytes(value));
2424
}
25+
26+
public int getValue() {
27+
return value;
28+
}
2529
}

src/main/java/io/github/seggan/javaclasslib/constantpool/types/LongEntry.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ public LongEntry(List<ConstantPoolEntry> constantPool, long value) {
2222
public byte[] getBytes() {
2323
return Bytes.concat(getTag().getByte(), ByteUtils.longToBytes(value));
2424
}
25+
26+
public long getValue() {
27+
return value;
28+
}
2529
}

src/main/java/io/github/seggan/javaclasslib/constantpool/types/StringEntry.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ public StringEntry(List<ConstantPoolEntry> constantPool, UTF8Entry string) {
2222
public byte[] getBytes() {
2323
return Bytes.concat(getTag().getByte(), string.getIndexBytes());
2424
}
25+
26+
public UTF8Entry getString() {
27+
return string;
28+
}
2529
}

0 commit comments

Comments
 (0)