Committed by
Thomas Vachuska
Move build method to each control msg, realize createBuilder method
Change-Id: Iff9e60cc5f929e031b0d927e0bdc08fed826e0db
Showing
9 changed files
with
36 additions
and
15 deletions
... | @@ -63,7 +63,7 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -63,7 +63,7 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
63 | 63 | ||
64 | @Override | 64 | @Override |
65 | public Builder createBuilder() { | 65 | public Builder createBuilder() { |
66 | - return null; | 66 | + return new DefaultNotifyBuilder(); |
67 | } | 67 | } |
68 | 68 | ||
69 | @Override | 69 | @Override |
... | @@ -135,7 +135,7 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -135,7 +135,7 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
135 | } | 135 | } |
136 | 136 | ||
137 | @Override | 137 | @Override |
138 | - public LispMessage build() { | 138 | + public LispMapNotify build() { |
139 | return new DefaultLispMapNotify(nonce, keyId, authenticationData, | 139 | return new DefaultLispMapNotify(nonce, keyId, authenticationData, |
140 | recordCount, mapRecords); | 140 | recordCount, mapRecords); |
141 | } | 141 | } | ... | ... |
... | @@ -71,7 +71,7 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -71,7 +71,7 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
71 | 71 | ||
72 | @Override | 72 | @Override |
73 | public Builder createBuilder() { | 73 | public Builder createBuilder() { |
74 | - return null; | 74 | + return new DefaultRegisterBuilder(); |
75 | } | 75 | } |
76 | 76 | ||
77 | @Override | 77 | @Override |
... | @@ -167,7 +167,7 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -167,7 +167,7 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
167 | } | 167 | } |
168 | 168 | ||
169 | @Override | 169 | @Override |
170 | - public LispMessage build() { | 170 | + public LispMapRegister build() { |
171 | return new DefaultLispMapRegister(nonce, keyId, authenticationData, | 171 | return new DefaultLispMapRegister(nonce, keyId, authenticationData, |
172 | recordCount, mapRecords, proxyMapReply, wantMapNotify); | 172 | recordCount, mapRecords, proxyMapReply, wantMapNotify); |
173 | } | 173 | } | ... | ... |
... | @@ -58,7 +58,7 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -58,7 +58,7 @@ public final class DefaultLispMapReply implements LispMapReply { |
58 | 58 | ||
59 | @Override | 59 | @Override |
60 | public Builder createBuilder() { | 60 | public Builder createBuilder() { |
61 | - return null; | 61 | + return new DefaultReplyBuilder(); |
62 | } | 62 | } |
63 | 63 | ||
64 | @Override | 64 | @Override |
... | @@ -130,7 +130,7 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -130,7 +130,7 @@ public final class DefaultLispMapReply implements LispMapReply { |
130 | } | 130 | } |
131 | 131 | ||
132 | @Override | 132 | @Override |
133 | - public LispMessage build() { | 133 | + public LispMapReply build() { |
134 | return new DefaultLispMapReply(nonce, recordCount, probe, etr, security); | 134 | return new DefaultLispMapReply(nonce, recordCount, probe, etr, security); |
135 | } | 135 | } |
136 | } | 136 | } | ... | ... |
... | @@ -83,7 +83,7 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -83,7 +83,7 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
83 | 83 | ||
84 | @Override | 84 | @Override |
85 | public Builder createBuilder() { | 85 | public Builder createBuilder() { |
86 | - return null; | 86 | + return new DefaultRequestBuilder(); |
87 | } | 87 | } |
88 | 88 | ||
89 | @Override | 89 | @Override |
... | @@ -228,7 +228,7 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -228,7 +228,7 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
228 | } | 228 | } |
229 | 229 | ||
230 | @Override | 230 | @Override |
231 | - public LispMessage build() { | 231 | + public LispMapRequest build() { |
232 | return new DefaultLispMapRequest(nonce, recordCount, sourceEid, itrRlocs, | 232 | return new DefaultLispMapRequest(nonce, recordCount, sourceEid, itrRlocs, |
233 | eidRecords, authoritative, mapDataPresent, probe, smr, pitr, smrInvoked); | 233 | eidRecords, authoritative, mapDataPresent, probe, smr, pitr, smrInvoked); |
234 | } | 234 | } | ... | ... |
... | @@ -135,5 +135,12 @@ public interface LispMapNotify extends LispMessage { | ... | @@ -135,5 +135,12 @@ public interface LispMapNotify extends LispMessage { |
135 | * @return NotifyBuilder object | 135 | * @return NotifyBuilder object |
136 | */ | 136 | */ |
137 | NotifyBuilder addRecord(LispMapRecord record); | 137 | NotifyBuilder addRecord(LispMapRecord record); |
138 | + | ||
139 | + /** | ||
140 | + * Builds LISP map notify message. | ||
141 | + * | ||
142 | + * @return LISP map notify message | ||
143 | + */ | ||
144 | + LispMapNotify build(); | ||
138 | } | 145 | } |
139 | } | 146 | } | ... | ... |
... | @@ -165,5 +165,12 @@ public interface LispMapRegister extends LispMessage { | ... | @@ -165,5 +165,12 @@ public interface LispMapRegister extends LispMessage { |
165 | * @return RegisterBuilder object | 165 | * @return RegisterBuilder object |
166 | */ | 166 | */ |
167 | RegisterBuilder addRecord(LispMapRecord record); | 167 | RegisterBuilder addRecord(LispMapRecord record); |
168 | + | ||
169 | + /** | ||
170 | + * Builds LISP map register message. | ||
171 | + * | ||
172 | + * @return LISP map register message | ||
173 | + */ | ||
174 | + LispMapRegister build(); | ||
168 | } | 175 | } |
169 | } | 176 | } | ... | ... |
... | @@ -129,5 +129,12 @@ public interface LispMapReply extends LispMessage { | ... | @@ -129,5 +129,12 @@ public interface LispMapReply extends LispMessage { |
129 | * @return ReplyBuilder object | 129 | * @return ReplyBuilder object |
130 | */ | 130 | */ |
131 | ReplyBuilder withNonce(long nonce); | 131 | ReplyBuilder withNonce(long nonce); |
132 | + | ||
133 | + /** | ||
134 | + * Builds LISP map reply message. | ||
135 | + * | ||
136 | + * @return LISP map reply message | ||
137 | + */ | ||
138 | + LispMapReply build(); | ||
132 | } | 139 | } |
133 | } | 140 | } | ... | ... |
... | @@ -224,5 +224,12 @@ public interface LispMapRequest extends LispMessage { | ... | @@ -224,5 +224,12 @@ public interface LispMapRequest extends LispMessage { |
224 | * @return RequestBuilder object | 224 | * @return RequestBuilder object |
225 | */ | 225 | */ |
226 | RequestBuilder addEidRecord(LispEidRecord record); | 226 | RequestBuilder addEidRecord(LispEidRecord record); |
227 | + | ||
228 | + /** | ||
229 | + * Builds LISP map request message. | ||
230 | + * | ||
231 | + * @return LISP map request message | ||
232 | + */ | ||
233 | + LispMapRequest build(); | ||
227 | } | 234 | } |
228 | } | 235 | } | ... | ... |
... | @@ -49,13 +49,6 @@ public interface LispMessage { | ... | @@ -49,13 +49,6 @@ public interface LispMessage { |
49 | interface Builder { | 49 | interface Builder { |
50 | 50 | ||
51 | /** | 51 | /** |
52 | - * Builds LISP message. | ||
53 | - * | ||
54 | - * @return LISP message | ||
55 | - */ | ||
56 | - LispMessage build(); | ||
57 | - | ||
58 | - /** | ||
59 | * Obtains LISP message type. | 52 | * Obtains LISP message type. |
60 | * | 53 | * |
61 | * @return LISP message type | 54 | * @return LISP message type | ... | ... |
-
Please register or login to post a comment