org.jlot.test.TomcatConfig Maven / Gradle / Ivy
package org.jlot.test;
import java.util.HashMap;
import java.util.Map;
public class TomcatConfig
{
private static final String HOST = "127.0.0.1";
private String name;
private String path;
private int port;
private int sslPort;
private Map properties = new HashMap();
public TomcatConfig ( String name, String path, int port, int sslPort )
{
if (path == null) throw new IllegalArgumentException();
this.name = name;
this.path = path;
this.port = port;
this.sslPort = sslPort;
}
public String getUrl ( )
{
return "https://" + HOST + ":" + sslPort + "/";
}
public void addProperty ( String key, String value )
{
properties.put(key, value);
}
public Map getProperties ( )
{
return properties;
}
public String getName ( )
{
return name;
}
public String getPath ( )
{
return path;
}
public int getSslPort ( )
{
return sslPort;
}
public int getPort ( )
{
return port;
}
@Override
public int hashCode ( )
{
return path.hashCode();
}
@Override
public boolean equals ( Object obj )
{
TomcatConfig otherJettyConfig = (TomcatConfig) obj;
return path.equals(otherJettyConfig.getPath());
}
}