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

org.babyfish.jimmer.client.generator.File Maven / Gradle / Ivy

There is a newer version: 0.9.35
Show newest version
package org.babyfish.jimmer.client.generator;

import java.util.Objects;

public class File {

    private final String dir;

    private final String name;

    public File(String dir, String name) {
        if (dir.startsWith("/")) {
            dir = dir.substring(1);
        }
        if (dir.endsWith("/")) {
            dir = dir.substring(0, dir.length() - 1);
        }
        this.dir = dir;
        this.name = name;
    }

    public String getDir() {
        return dir;
    }

    public String getName() {
        return name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        File file = (File) o;
        return dir.equals(file.dir) && name.equals(file.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(dir, name);
    }

    @Override
    public String toString() {
        return dir + '/' + name;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy