OSDN Git Service

確実に不要になるクラスを削除
[coroid/inqubus.git] / frontend / src / saccubus / converter / classic / profile / Proxy.java
1 /* $Id$ */
2 package saccubus.converter.classic.profile;
3
4 import org.apache.commons.lang.StringUtils;
5
6 /**
7  *
8  * @author yuki
9  */
10 public class Proxy implements yukihane.saccubus.converter.profile.ProxyProfile {
11
12     private String host;
13     private int port;
14     public static final Proxy NO_PROXY = new Proxy();
15
16     private Proxy() {
17         this.host = null;
18         this.port = -1;
19     }
20
21     public Proxy(String host, int port) {
22         if (StringUtils.isEmpty(host) || port < 0 || port > 65535) {
23             throw new IllegalArgumentException("プロキシの設定が不適切です");
24         }
25         this.host = host;
26         this.port = port;
27     }
28
29     public boolean use(){
30         return this != NO_PROXY;
31     }
32
33     public String getHost() {
34         return host;
35     }
36
37     public int getPort() {
38         return port;
39     }
40 }