001/*
002 * Copyright (c) 2015-2020, Oracle and/or its affiliates. All rights reserved.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.tribuo;
017
018/**
019 * This class stores the current Tribuo version, along with other compile time information.
020 */
021public final class Tribuo {
022    /**
023     * The full Tribuo version string.
024     */
025    public static final String VERSION = "4.0.2";
026
027    /**
028     * The build timestamp.
029     */
030    public static final String BUILD_TIMESTAMP = "${maven.build.timestamp}";
031
032    /**
033     * The major version number.
034     */
035    public static final int MAJOR_VERSION;
036
037    /**
038     * The minor version number.
039     */
040    public static final int MINOR_VERSION;
041
042    /**
043     * The patch release number.
044     */
045    public static final int POINT_VERSION;
046
047    /**
048     * Any tag on the version number, e.g., SNAPSHOT, ALPHA, etc.
049     */
050    public static final String TAG_VERSION;
051
052    /**
053     * Is this a snapshot build.
054     */
055    public static final boolean IS_SNAPSHOT;
056
057    static {
058        String[] splitVersion = VERSION.split("\\.");
059        MAJOR_VERSION = Integer.parseInt(splitVersion[0]);
060        MINOR_VERSION = Integer.parseInt(splitVersion[1]);
061        IS_SNAPSHOT = VERSION.contains("SNAPSHOT");
062        String[] tags = splitVersion[2].split("-");
063        POINT_VERSION = Integer.parseInt(tags[0]);
064        if (tags.length > 1) {
065            TAG_VERSION = tags[1];
066        } else {
067            TAG_VERSION = "";
068        }
069    }
070}