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

website.automate.teamcity.server.support.Mapper Maven / Gradle / Ivy

package website.automate.teamcity.server.support;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public abstract class Mapper {

    public abstract T map(S source);
    
    public T safeMap(S source){
        if(source == null){
            return null;
        }
        return map(source);
    }
    
    public List safeMapCollection(Collection sources){
        List targets = new ArrayList();
        if(sources == null){
            return Collections.emptyList();
        }
        for(S source : sources){
            targets.add(map(source));
        }
        return targets;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy