-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathUrlBuilder.java
132 lines (121 loc) · 3.26 KB
/
UrlBuilder.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package samples;
import java.net.URL;
import java.net.URLStreamHandler;
import javaxfake.annotation.Generated;
import net.karneim.pojobuilder.GwtIncompatible;
@Generated("PojoBuilder")
public class UrlBuilder
implements Cloneable {
protected UrlBuilder self;
protected String value$protocol$java$lang$String;
protected boolean isSet$protocol$java$lang$String;
protected String value$host$java$lang$String;
protected boolean isSet$host$java$lang$String;
protected int value$port$int;
protected boolean isSet$port$int;
protected String value$file$java$lang$String;
protected boolean isSet$file$java$lang$String;
protected URLStreamHandler value$handler$java$net$URLStreamHandler;
protected boolean isSet$handler$java$net$URLStreamHandler;
/**
* Creates a new {@link UrlBuilder}.
*/
public UrlBuilder() {
self = (UrlBuilder)this;
}
/**
* Sets the default value for the protocol property.
*
* @param value the default value
* @return this builder
*/
public UrlBuilder withProtocol(String value) {
this.value$protocol$java$lang$String = value;
this.isSet$protocol$java$lang$String = true;
return self;
}
/**
* Sets the default value for the host property.
*
* @param value the default value
* @return this builder
*/
public UrlBuilder withHost(String value) {
this.value$host$java$lang$String = value;
this.isSet$host$java$lang$String = true;
return self;
}
/**
* Sets the default value for the port property.
*
* @param value the default value
* @return this builder
*/
public UrlBuilder withPort(int value) {
this.value$port$int = value;
this.isSet$port$int = true;
return self;
}
/**
* Sets the default value for the file property.
*
* @param value the default value
* @return this builder
*/
public UrlBuilder withFile(String value) {
this.value$file$java$lang$String = value;
this.isSet$file$java$lang$String = true;
return self;
}
/**
* Sets the default value for the handler property.
*
* @param value the default value
* @return this builder
*/
public UrlBuilder withHandler(URLStreamHandler value) {
this.value$handler$java$net$URLStreamHandler = value;
this.isSet$handler$java$net$URLStreamHandler = true;
return self;
}
/**
* Returns a clone of this builder.
*
* @return the clone
*/
@Override
@GwtIncompatible
public Object clone() {
try {
UrlBuilder result = (UrlBuilder)super.clone();
result.self = result;
return result;
} catch (CloneNotSupportedException e) {
throw new InternalError(e.getMessage());
}
}
/**
* Returns a clone of this builder.
*
* @return the clone
*/
@GwtIncompatible
public UrlBuilder but() {
return (UrlBuilder)clone();
}
/**
* Creates a new {@link URL} based on this builder's settings.
*
* @return the created URL
*/
public URL build() {
try {
URL result = UrlFactory.createUrl(value$protocol$java$lang$String, value$host$java$lang$String, value$port$int, value$file$java$lang$String, value$handler$java$net$URLStreamHandler);
return result;
} catch (RuntimeException ex) {
throw ex;
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}