Jian Li
Committed by Thomas Vachuska

Move build method to each control msg, realize createBuilder method

Change-Id: Iff9e60cc5f929e031b0d927e0bdc08fed826e0db
......@@ -63,7 +63,7 @@ public final class DefaultLispMapNotify implements LispMapNotify {
@Override
public Builder createBuilder() {
return null;
return new DefaultNotifyBuilder();
}
@Override
......@@ -135,7 +135,7 @@ public final class DefaultLispMapNotify implements LispMapNotify {
}
@Override
public LispMessage build() {
public LispMapNotify build() {
return new DefaultLispMapNotify(nonce, keyId, authenticationData,
recordCount, mapRecords);
}
......
......@@ -71,7 +71,7 @@ public final class DefaultLispMapRegister implements LispMapRegister {
@Override
public Builder createBuilder() {
return null;
return new DefaultRegisterBuilder();
}
@Override
......@@ -167,7 +167,7 @@ public final class DefaultLispMapRegister implements LispMapRegister {
}
@Override
public LispMessage build() {
public LispMapRegister build() {
return new DefaultLispMapRegister(nonce, keyId, authenticationData,
recordCount, mapRecords, proxyMapReply, wantMapNotify);
}
......
......@@ -58,7 +58,7 @@ public final class DefaultLispMapReply implements LispMapReply {
@Override
public Builder createBuilder() {
return null;
return new DefaultReplyBuilder();
}
@Override
......@@ -130,7 +130,7 @@ public final class DefaultLispMapReply implements LispMapReply {
}
@Override
public LispMessage build() {
public LispMapReply build() {
return new DefaultLispMapReply(nonce, recordCount, probe, etr, security);
}
}
......
......@@ -83,7 +83,7 @@ public final class DefaultLispMapRequest implements LispMapRequest {
@Override
public Builder createBuilder() {
return null;
return new DefaultRequestBuilder();
}
@Override
......@@ -228,7 +228,7 @@ public final class DefaultLispMapRequest implements LispMapRequest {
}
@Override
public LispMessage build() {
public LispMapRequest build() {
return new DefaultLispMapRequest(nonce, recordCount, sourceEid, itrRlocs,
eidRecords, authoritative, mapDataPresent, probe, smr, pitr, smrInvoked);
}
......
......@@ -135,5 +135,12 @@ public interface LispMapNotify extends LispMessage {
* @return NotifyBuilder object
*/
NotifyBuilder addRecord(LispMapRecord record);
/**
* Builds LISP map notify message.
*
* @return LISP map notify message
*/
LispMapNotify build();
}
}
......
......@@ -165,5 +165,12 @@ public interface LispMapRegister extends LispMessage {
* @return RegisterBuilder object
*/
RegisterBuilder addRecord(LispMapRecord record);
/**
* Builds LISP map register message.
*
* @return LISP map register message
*/
LispMapRegister build();
}
}
......
......@@ -129,5 +129,12 @@ public interface LispMapReply extends LispMessage {
* @return ReplyBuilder object
*/
ReplyBuilder withNonce(long nonce);
/**
* Builds LISP map reply message.
*
* @return LISP map reply message
*/
LispMapReply build();
}
}
......
......@@ -224,5 +224,12 @@ public interface LispMapRequest extends LispMessage {
* @return RequestBuilder object
*/
RequestBuilder addEidRecord(LispEidRecord record);
/**
* Builds LISP map request message.
*
* @return LISP map request message
*/
LispMapRequest build();
}
}
......
......@@ -49,13 +49,6 @@ public interface LispMessage {
interface Builder {
/**
* Builds LISP message.
*
* @return LISP message
*/
LispMessage build();
/**
* Obtains LISP message type.
*
* @return LISP message type
......