All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jfrog.build.api.release.BintrayUploadInfoOverride Maven / Gradle / Ivy

There is a newer version: 2.41.23
Show newest version
package org.jfrog.build.api.release;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * Represents override properties that can be passed to artifactory with the REST command instead of the descriptor
 *
 * @author Dan Feldman
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class BintrayUploadInfoOverride {

    public String subject;
    public String repoName;
    public String packageName;
    public String versionName;
    public List licenses; //Mandatory only for OSS
    @JsonProperty("vcs_url")
    public String vcsUrl;         //Mandatory only for OSS

    public BintrayUploadInfoOverride() {

    }

    public BintrayUploadInfoOverride(String subject, String repoName, String packageName, String versionName,
                                     List licenses, String vcsUrl) {
        this.subject = subject;
        this.repoName = repoName;
        this.packageName = packageName;
        this.versionName = versionName;
        this.licenses = licenses;
        this.vcsUrl = vcsUrl;
    }

    @JsonIgnore
    public boolean isValid() {
        return (StringUtils.isNotBlank(subject) && StringUtils.isNotBlank(repoName)
                && StringUtils.isNotBlank(packageName) && StringUtils.isNotBlank(versionName));
    }

    @JsonIgnore
    public boolean isEmpty() {
        return subject == null && repoName == null && packageName == null && versionName == null
                && (licenses == null || licenses.isEmpty()) && vcsUrl == null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy