class WineryVersion implements Comparable<WineryVersion> {

    @Override
    @ADR(19)
    public int compareTo(WineryVersion o) {
        if (Objects.isNull(o)) {
            return 1;
        }

        int cVersion = this.componentVersion.compareToIgnoreCase(o.componentVersion);
        if (cVersion < 0) {
            return -1;
        } else if (cVersion > 0) {
            return 1;
        }

        if (this.wineryVersion < o.wineryVersion) {
            return -1;
        } else if (this.wineryVersion > o.wineryVersion) {
            return 1;
        }

        if (this.wineryVersion > 0 && this.workInProgressVersion == 0) {
            return 1;
        } else if (o.wineryVersion > 0 && o.workInProgressVersion == 0) {
            return -1;
        }

        if (this.workInProgressVersion < o.workInProgressVersion) {
            return -1;
        } else if (this.workInProgressVersion > o.workInProgressVersion) {
            return 1;
        }

        return 0;
    }

    public  WineryVersion();
    public  WineryVersion(String componentVersion, int wineryVersion, int workInProgressVersion);

}