Skip to content

Commit

Permalink
feat: abstract numerical tag
Browse files Browse the repository at this point in the history
  • Loading branch information
BitBuf committed Aug 20, 2021
1 parent eb3b141 commit b7b7ad9
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/main/java/dev/dewy/nbt/tags/primitive/NumericalTag.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package dev.dewy.nbt.tags.primitive;

import dev.dewy.nbt.Tag;

public abstract class NumericalTag<T extends Number> extends Tag {
@Override
public abstract T getValue();

public byte byteValue() {
return this.getValue().byteValue();
}

public short shortValue() {
return this.getValue().shortValue();
}

public int intValue() {
return this.getValue().intValue();
}

public long longValue() {
return this.getValue().longValue();
}

public float floatValue() {
return this.getValue().floatValue();
}

public double doubleValue() {
return this.getValue().doubleValue();
}
}

0 comments on commit b7b7ad9

Please sign in to comment.