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

de.zebrajaeger.opencms.resourceplugin.namingstrategy.AbstractNamingStrategy Maven / Gradle / Ivy

package de.zebrajaeger.opencms.resourceplugin.namingstrategy;

public abstract class AbstractNamingStrategy implements NamingStrategy {
    private String name;
    private String convertedName;

    public AbstractNamingStrategy(String name) {
        this.name = name;
    }

    protected abstract String convert(String newResourceName);

    @Override
    public String getConvertedName() {
        if (convertedName == null) {
            convertedName = convert(name);
        }
        return convertedName;
    }

    @Override
    public String toString() {
        return this.getClass().getSimpleName() + "(" + name + " -> " + getConvertedName() + ")";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy