// Generated by delombok at Tue Dec 16 19:36:13 UTC 2025
package net.md_5.bungee.module;

public class ModuleVersion {
    private final String build;
    private final String git;

    public static ModuleVersion parse(String version) {
        int lastColon = version.lastIndexOf(':');
        int secondLastColon = version.lastIndexOf(':', lastColon - 1);
        if (lastColon == -1 || secondLastColon == -1) {
            return null;
        }
        String buildNumber = version.substring(lastColon + 1, version.length());
        String gitCommit = version.substring(secondLastColon + 1, lastColon).replaceAll("\"", "");
        if ("unknown".equals(buildNumber) || "unknown".equals(gitCommit)) {
            return null;
        }
        return new ModuleVersion(buildNumber, gitCommit);
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getBuild() {
        return this.build;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getGit() {
        return this.git;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public boolean equals(final java.lang.Object o) {
        if (o == this) return true;
        if (!(o instanceof ModuleVersion)) return false;
        final ModuleVersion other = (ModuleVersion) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        final java.lang.Object this$build = this.getBuild();
        final java.lang.Object other$build = other.getBuild();
        if (this$build == null ? other$build != null : !this$build.equals(other$build)) return false;
        final java.lang.Object this$git = this.getGit();
        final java.lang.Object other$git = other.getGit();
        if (this$git == null ? other$git != null : !this$git.equals(other$git)) return false;
        return true;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected boolean canEqual(final java.lang.Object other) {
        return other instanceof ModuleVersion;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final java.lang.Object $build = this.getBuild();
        result = result * PRIME + ($build == null ? 43 : $build.hashCode());
        final java.lang.Object $git = this.getGit();
        result = result * PRIME + ($git == null ? 43 : $git.hashCode());
        return result;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "ModuleVersion(build=" + this.getBuild() + ", git=" + this.getGit() + ")";
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    private ModuleVersion(final String build, final String git) {
        this.build = build;
        this.git = git;
    }
}
