The result type used for org.quiltmc.chasm.api.ChasmProcessor#process().
| 8 | * The result type used for {@link org.quiltmc.chasm.api.ChasmProcessor#process()}. |
| 9 | */ |
| 10 | public class ClassResult { |
| 11 | private final byte @Nullable [] classBytes; |
| 12 | |
| 13 | private final @NotNull Metadata metadata; |
| 14 | |
| 15 | private final @NotNull Type type; |
| 16 | |
| 17 | /** |
| 18 | * Create a new {@link ClassResult}. |
| 19 | * |
| 20 | * @param classBytes The bytes representing the class of this result, |
| 21 | * or {@code null} if {@code type = Type.Removed}. |
| 22 | * @param metadata The metadata associated with the class of this result. |
| 23 | * @param type The {@link Type} of this result. |
| 24 | */ |
| 25 | public ClassResult(byte @Nullable [] classBytes, @NotNull Metadata metadata, @NotNull Type type) { |
| 26 | this.classBytes = classBytes; |
| 27 | this.metadata = metadata; |
| 28 | this.type = type; |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Get the bytes representing the class of this result. |
| 33 | * This will be {@code null} if and only if {@link #getType} is {@link Type#REMOVED}. |
| 34 | * |
| 35 | * @return The bytes representing the class of this result, |
| 36 | * or {@code null} if {@link #getType} is {@link Type#REMOVED}. |
| 37 | */ |
| 38 | public byte @Nullable [] getClassBytes() { |
| 39 | return classBytes; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Get the {@link Metadata} associated with the class of this result. |
| 44 | * |
| 45 | * @return The {@link Metadata} of the class. |
| 46 | */ |
| 47 | public @NotNull Metadata getMetadata() { |
| 48 | return metadata; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Get the {@link Type} of this result. |
| 53 | * |
| 54 | * @return The {@link Type} of this result. |
| 55 | */ |
| 56 | public @NotNull Type getType() { |
| 57 | return type; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Represents the possible outcomes of {@link ClassResult}. |
| 62 | */ |
| 63 | public enum Type { |
| 64 | /** |
| 65 | * Indicates that the class hasn't been modified during processing. |
| 66 | * Note that this doesn't apply to {@link org.quiltmc.chasm.lang.api.metadata.Metadata}. |
| 67 | */ |
nothing calls this directly
no outgoing calls
no test coverage detected