// Path: cassandra-migration/src/main/java/org/cognitor/cassandra/migration/util/Ensure.java
// public static String notNullOrEmpty(String argument, String argumentName) {
//     if (argument == null || argument.trim().isEmpty()) {
//         throw new IllegalArgumentException("Argument " + argumentName + " must not be null or empty.");
//     }
//     return argument;
// }


import static org.cognitor.cassandra.migration.util.Ensure.notNullOrEmpty;
package org.cognitor.cassandra.migration.collector;


/**
 * This file represents a script inside the <code>MigrationRepository</code>
 * while it is initialized and the collector for script files is done.
 *
 * This file only includes the files metadata, currently the version number,
 * the resource name and the script name. The content of the script files is read in
 * case migration scripts are requested from the repository. For performance reasons
 * it is not done during the collector as it might not be required to read the files
 * in case the database schema is up to date.
 *
 * This class implements the {@link Comparable} interface in order to sort the
 * scripts by the version.
 *
 * @author Patrick Kranz
 */
public class ScriptFile implements Comparable {
    private final int version;
    private final String resourceName;
    private final String scriptName;

    /**
     * A constructor taken all relevant information for a script. All
     * arguments are required.
     *
     * @param version the version that this script represents. This is the number in the
     *                beginning of the file name.
     * @param resourceName the name of the resource that represents the script inside the classpath
     * @param scriptName the name of the script itself. Normally everything from the file name except
     *                   the version
     */
    public ScriptFile(int version, String resourceName, String scriptName) {
        this.version = version;
// Path: cassandra-migration/src/main/java/org/cognitor/cassandra/migration/util/Ensure.java
// public static String notNullOrEmpty(String argument, String argumentName) {
//     if (argument == null || argument.trim().isEmpty()) {
//         throw new IllegalArgumentException("Argument " + argumentName + " must not be null or empty.");
//     }
//     return argument;
// }


// Path: cassandra-migration/src/main/java/org/cognitor/cassandra/migration/collector/ScriptFile.java
import static org.cognitor.cassandra.migration.util.Ensure.notNullOrEmpty;

package org.cognitor.cassandra.migration.collector;


/**
 * This file represents a script inside the <code>MigrationRepository</code>
 * while it is initialized and the collector for script files is done.
 *
 * This file only includes the files metadata, currently the version number,
 * the resource name and the script name. The content of the script files is read in
 * case migration scripts are requested from the repository. For performance reasons
 * it is not done during the collector as it might not be required to read the files
 * in case the database schema is up to date.
 *
 * This class implements the {@link Comparable} interface in order to sort the
 * scripts by the version.
 *
 * @author Patrick Kranz
 */
public class ScriptFile implements Comparable {
    private final int version;
    private final String resourceName;
    private final String scriptName;

    /**
     * A constructor taken all relevant information for a script. All
     * arguments are required.
     *
     * @param version the version that this script represents. This is the number in the
     *                beginning of the file name.
     * @param resourceName the name of the resource that represents the script inside the classpath
     * @param scriptName the name of the script itself. Normally everything from the file name except
     *                   the version
     */
    public ScriptFile(int version, String resourceName, String scriptName) {
        this.version = version;
        this.resourceName = notNullOrEmpty(resourceName, "resourceName");