001/*
002 * JDrupes Builder
003 * Copyright (C) 2026 Michael N. Lipp
004 * 
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Affero General Public License as
007 * published by the Free Software Foundation, either version 3 of the
008 * License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013 * GNU Affero General Public License for more details.
014 *
015 * You should have received a copy of the GNU Affero General Public License
016 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
017 */
018
019package org.jdrupes.builder.api;
020
021import static org.jdrupes.builder.api.ResourceType.*;
022
023/// A resource that carries the version string of a project.
024///
025public interface ProjectVersion extends Resource {
026
027    /// Returns the project the version belongs to.
028    ///
029    /// @return the project
030    ///
031    Project project();
032
033    /// Returns the version string.
034    ///
035    /// @return the version
036    ///
037    String version();
038
039    /// Creates a new project version.
040    ///
041    /// @param project the project
042    /// @param version the version
043    /// @return the project version
044    ///
045    @SuppressWarnings("PMD.ShortMethodName")
046    static ProjectVersion of(Project project, String version) {
047        return ResourceFactory.create(
048            ProjectVersionType, project, version);
049    }
050}