Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Source code recreated from a .class file by IntelliJ IDEA
- // (powered by Fernflower decompiler)
- //
- package fr.nexion.base.punishment;
- import fr.nexion.api.databases.Database;
- import fr.nexion.api.utils.TaskRunner;
- import fr.nexion.base.NexionBase;
- import lombok.NonNull;
- import org.bukkit.entity.Player;
- public class Punishment {
- private static final String[] COLUMNS = new String[]{"type", "user", "reason", "author", "expiration"};
- @NonNull
- private String type;
- @NonNull
- private String reason;
- @NonNull
- private String author;
- @NonNull
- private String user;
- @NonNull
- private String created;
- private long expirationMillis;
- public void persist() {
- Database database = NexionBase.getInstance().getDataBase();
- Object[] values = new Object[]{this.type, this.user, this.reason, this.author, this.expirationMillis};
- TaskRunner.ASYNC.runTask(() -> {
- database.insertIntoOrUpdate("punishments", COLUMNS, values, false);
- }, NexionBase.getInstance());
- }
- public void apply(Player player, Player author) {
- }
- public PunishmentType getPunishmentType() {
- return PunishmentType.valueOf(this.type);
- }
- Punishment(@NonNull String type, @NonNull String reason, @NonNull String author, @NonNull String user, @NonNull String created, long expirationMillis) {
- if (type == null) {
- throw new NullPointerException("type is marked non-null but is null");
- } else if (reason == null) {
- throw new NullPointerException("reason is marked non-null but is null");
- } else if (author == null) {
- throw new NullPointerException("author is marked non-null but is null");
- } else if (user == null) {
- throw new NullPointerException("user is marked non-null but is null");
- } else if (created == null) {
- throw new NullPointerException("created is marked non-null but is null");
- } else {
- this.type = type;
- this.reason = reason;
- this.author = author;
- this.user = user;
- this.created = created;
- this.expirationMillis = expirationMillis;
- }
- }
- public static fr.nexion.base.punishment.Punishment.PunishmentBuilder builder() {
- return new fr.nexion.base.punishment.Punishment.PunishmentBuilder();
- }
- @NonNull
- public String getType() {
- return this.type;
- }
- @NonNull
- public String getReason() {
- return this.reason;
- }
- @NonNull
- public String getAuthor() {
- return this.author;
- }
- @NonNull
- public String getUser() {
- return this.user;
- }
- @NonNull
- public String getCreated() {
- return this.created;
- }
- public long getExpirationMillis() {
- return this.expirationMillis;
- }
- public void setType(@NonNull String type) {
- if (type == null) {
- throw new NullPointerException("type is marked non-null but is null");
- } else {
- this.type = type;
- }
- }
- public void setReason(@NonNull String reason) {
- if (reason == null) {
- throw new NullPointerException("reason is marked non-null but is null");
- } else {
- this.reason = reason;
- }
- }
- public void setAuthor(@NonNull String author) {
- if (author == null) {
- throw new NullPointerException("author is marked non-null but is null");
- } else {
- this.author = author;
- }
- }
- public void setUser(@NonNull String user) {
- if (user == null) {
- throw new NullPointerException("user is marked non-null but is null");
- } else {
- this.user = user;
- }
- }
- public void setCreated(@NonNull String created) {
- if (created == null) {
- throw new NullPointerException("created is marked non-null but is null");
- } else {
- this.created = created;
- }
- }
- public void setExpirationMillis(long expirationMillis) {
- this.expirationMillis = expirationMillis;
- }
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- } else if (!(o instanceof Punishment)) {
- return false;
- } else {
- Punishment other = (Punishment)o;
- if (!other.canEqual(this)) {
- return false;
- } else {
- label75: {
- Object this$type = this.getType();
- Object other$type = other.getType();
- if (this$type == null) {
- if (other$type == null) {
- break label75;
- }
- } else if (this$type.equals(other$type)) {
- break label75;
- }
- return false;
- }
- Object this$reason = this.getReason();
- Object other$reason = other.getReason();
- if (this$reason == null) {
- if (other$reason != null) {
- return false;
- }
- } else if (!this$reason.equals(other$reason)) {
- return false;
- }
- Object this$author = this.getAuthor();
- Object other$author = other.getAuthor();
- if (this$author == null) {
- if (other$author != null) {
- return false;
- }
- } else if (!this$author.equals(other$author)) {
- return false;
- }
- label54: {
- Object this$user = this.getUser();
- Object other$user = other.getUser();
- if (this$user == null) {
- if (other$user == null) {
- break label54;
- }
- } else if (this$user.equals(other$user)) {
- break label54;
- }
- return false;
- }
- label47: {
- Object this$created = this.getCreated();
- Object other$created = other.getCreated();
- if (this$created == null) {
- if (other$created == null) {
- break label47;
- }
- } else if (this$created.equals(other$created)) {
- break label47;
- }
- return false;
- }
- if (this.getExpirationMillis() != other.getExpirationMillis()) {
- return false;
- } else {
- return true;
- }
- }
- }
- }
- protected boolean canEqual(Object other) {
- return other instanceof Punishment;
- }
- public int hashCode() {
- int PRIME = true;
- int result = 1;
- Object $type = this.getType();
- int result = result * 59 + ($type == null ? 43 : $type.hashCode());
- Object $reason = this.getReason();
- result = result * 59 + ($reason == null ? 43 : $reason.hashCode());
- Object $author = this.getAuthor();
- result = result * 59 + ($author == null ? 43 : $author.hashCode());
- Object $user = this.getUser();
- result = result * 59 + ($user == null ? 43 : $user.hashCode());
- Object $created = this.getCreated();
- result = result * 59 + ($created == null ? 43 : $created.hashCode());
- long $expirationMillis = this.getExpirationMillis();
- result = result * 59 + (int)($expirationMillis >>> 32 ^ $expirationMillis);
- return result;
- }
- public String toString() {
- return "Punishment(type=" + this.getType() + ", reason=" + this.getReason() + ", author=" + this.getAuthor() + ", user=" + this.getUser() + ", created=" + this.getCreated() + ", expirationMillis=" + this.getExpirationMillis() + ")";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement