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

com.metaeffekt.artifact.analysis.version.curation.ExtractedCuratedVersionParts Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2021-2024 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.metaeffekt.artifact.analysis.version.curation;

import com.metaeffekt.artifact.analysis.version.token.VersionToken;
import org.json.JSONObject;

public class ExtractedCuratedVersionParts {

    private VersionToken specVersion;
    private VersionToken semVersion;
    private VersionToken buildVersion;
    private VersionToken versionModifier;
    private VersionToken otherVersionPart;
    private VersionToken afterAllPart;
    private String preprocessedVersionToBeTokenized;

    public ExtractedCuratedVersionParts() {
    }

    public ExtractedCuratedVersionParts(String preprocessedVersionToBeTokenized) {
        this.preprocessedVersionToBeTokenized = preprocessedVersionToBeTokenized;
    }

    public ExtractedCuratedVersionParts(VersionToken specVersion, VersionToken semVersion, VersionToken buildVersion, VersionToken versionModifier, VersionToken otherVersionPart, VersionToken afterAllPart) {
        this.specVersion = specVersion;
        this.semVersion = semVersion;
        this.buildVersion = buildVersion;
        this.versionModifier = versionModifier;
        this.otherVersionPart = otherVersionPart;
        this.afterAllPart = afterAllPart;
    }

    public VersionToken getSpecVersion() {
        return specVersion;
    }

    public void setSpecVersion(VersionToken specVersion) {
        this.specVersion = specVersion;
    }

    public VersionToken getSemVersion() {
        return semVersion;
    }

    public void setSemVersion(VersionToken semVersion) {
        this.semVersion = semVersion;
    }

    public VersionToken getBuildVersion() {
        return buildVersion;
    }

    public void setBuildVersion(VersionToken buildVersion) {
        this.buildVersion = buildVersion;
    }

    public VersionToken getVersionModifier() {
        return versionModifier;
    }

    public void setVersionModifier(VersionToken versionModifier) {
        this.versionModifier = versionModifier;
    }

    public VersionToken getOtherVersionPart() {
        return otherVersionPart;
    }

    public void setOtherVersionPart(VersionToken otherVersionPart) {
        this.otherVersionPart = otherVersionPart;
    }

    public VersionToken getAfterAllPart() {
        return afterAllPart;
    }

    public void setAfterAllPart(VersionToken afterAllPart) {
        this.afterAllPart = afterAllPart;
    }

    public void setPreprocessedVersionToBeTokenized(String preprocessedVersionToBeTokenized) {
        this.preprocessedVersionToBeTokenized = preprocessedVersionToBeTokenized;
    }

    public String getPreprocessedVersionToBeTokenized() {
        return preprocessedVersionToBeTokenized;
    }

    public boolean isPreprocessorType() {
        return preprocessedVersionToBeTokenized != null;
    }

    public JSONObject toJson() {
        return new JSONObject()
                .put("spec", specVersion)
                .put("sem", semVersion)
                .put("build", buildVersion)
                .put("modifier", versionModifier)
                .put("other", otherVersionPart)
                .put("afterAll", afterAllPart)
                .put("preprocessed", preprocessedVersionToBeTokenized);
    }

    @Override
    public String toString() {
        return toJson().toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy