* @return The string representation of the next hop address type
*/
public String getNextHopType() {
- if (nextHopType == null)
+ if (nextHopType == null) {
return StaticRoute.NextHopType.IPADDRESS.toString();
+ }
return nextHopType;
}
public Status isValid() {
if ((name == null) || (name.trim().length() < 1)) {
return new Status(StatusCode.BADREQUEST,
- "Invalid Static Route name");
+ "Invalid Static Route name");
}
if (!isValidStaticRouteEntry()) {
return new Status(StatusCode.BADREQUEST,
- "Invalid Static Route entry. Please use the " +
- "IPAddress/mask format. Default gateway " +
- "(0.0.0.0/0) is NOT supported.");
+ "Invalid Static Route entry. Please use the " +
+ "IPAddress/mask format. Default gateway " +
+ "(0.0.0.0/0) is NOT supported.");
}
if (!isValidNextHop()) {
return new Status(StatusCode.BADREQUEST,
- "Invalid NextHop IP Address configuration. " +
- "Please use the X.X.X.X format.");
+ "Invalid NextHop IP Address configuration. " +
+ "Please use the X.X.X.X format.");
}
return new Status(StatusCode.SUCCESS, null);
* @return The IP address
*/
public InetAddress getStaticRouteIP() {
- if (!isValidStaticRouteEntry())
+ if (!isValidStaticRouteEntry()) {
return null;
+ }
InetAddress ip = null;
try {
ip = InetAddress.getByName(staticRoute.split("/")[0]);
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
StaticRouteConfig other = (StaticRouteConfig) obj;
if (name == null) {
if (other.name != null)