Checkstyle enforcer
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / utils / NetUtils.java
index 2591d931e1d70e5084531c464f8c2b8c5209317f..74da40449646059b640e96465b9b01bbf93ac2d5 100644 (file)
@@ -36,8 +36,8 @@ public abstract class NetUtils {
     /**
      * Converts a 4 bytes array into an integer number
      *
-     * @param ba       the 4 bytes long byte array
-     * @return     the integer number
+     * @param ba    the 4 bytes long byte array
+     * @return      the integer number
      */
     public static int byteArray4ToInt(byte[] ba) {
         if (ba == null || ba.length != 4) {
@@ -63,8 +63,8 @@ public abstract class NetUtils {
      * Converts an IP address passed as integer value into the
      * respective InetAddress object
      *
-     * @param address  the IP address in integer form
-     * @return                 the IP address in InetAddress form
+     * @param address   the IP address in integer form
+     * @return          the IP address in InetAddress form
      */
     public static InetAddress getInetAddress(int address) {
         InetAddress ip = null;
@@ -81,8 +81,8 @@ public abstract class NetUtils {
      * The prefix bit mask indicates the contiguous leading bits that are NOT masked out.
      * Example: A prefix bit mask length of 8 will give an InetAddress Network Mask of 255.0.0.0
      *
-     * @param prefixMaskLength integer representing the length of the prefix network mask
-     * @param isV6                             boolean representing the IP version of the returned address
+     * @param prefixMaskLength  integer representing the length of the prefix network mask
+     * @param isV6              boolean representing the IP version of the returned address
      * @return
      */
     public static InetAddress getInetNetworkMask(int prefixMaskLength,
@@ -122,8 +122,8 @@ public abstract class NetUtils {
      * while ff.00.00.00 will return a subnet mask length of 24.
      * If the passed prefixMask object is null, 0 is returned
      *
-     * @param prefixMask       the prefix mask as byte array
-     * @return                         the length of the prefix network mask
+     * @param prefixMask    the prefix mask as byte array
+     * @return              the length of the prefix network mask
      */
     public static int getSubnetMaskLength(byte[] prefixMask) {
         int maskLength = 0;
@@ -150,8 +150,8 @@ public abstract class NetUtils {
      * while ff.00.00.00 will return a subnet mask length of 24
      * If the passed prefixMask object is null, 0 is returned
      *
-     * @param prefixMask       the prefix mask as InetAddress
-     * @return                         the length of the prefix network mask
+     * @param prefixMask    the prefix mask as InetAddress
+     * @return              the length of the prefix network mask
      */
     public static int getSubnetMaskLength(InetAddress prefixMask) {
         return (prefixMask == null) ? 0 : NetUtils
@@ -163,9 +163,9 @@ public abstract class NetUtils {
      * the equivalent subnet prefix IP address
      * Example: for ip = "172.28.30.254" and maskLen = 25 it will return "172.28.30.128"
      *
-     * @param ip               the IP address in InetAddress form
-     * @param maskLen  the length of the prefix network mask
-     * @return                 the subnet prefix IP address in InetAddress form
+     * @param ip        the IP address in InetAddress form
+     * @param maskLen   the length of the prefix network mask
+     * @return          the subnet prefix IP address in InetAddress form
      */
     public static InetAddress getSubnetPrefix(InetAddress ip, int maskLen) {
         int bytes = maskLen / 8;
@@ -241,8 +241,8 @@ public abstract class NetUtils {
     /**
      * Returns true if the passed MAC address is all zero
      *
-     * @param mac      the byte array representing the MAC address
-     * @return         true if all MAC bytes are zero
+     * @param mac   the byte array representing the MAC address
+     * @return      true if all MAC bytes are zero
      */
     public static boolean isZeroMAC(byte[] mac) {
         for (short i = 0; i < 6; i++) {
@@ -256,8 +256,8 @@ public abstract class NetUtils {
     /**
      * Returns true if the passed InetAddress contains all zero
      *
-     * @param ip       the IP address to test
-     * @return         true if the address is all zero
+     * @param ip    the IP address to test
+     * @return      true if the address is all zero
      */
     public static boolean isAny(InetAddress ip) {
         for (byte b : ip.getAddress()) {
@@ -366,12 +366,12 @@ public abstract class NetUtils {
     /**
      * Returns the unsigned value of the passed byte variable
      *
-     * @param b        the byte value
+     * @param b the byte value
      * @return the int variable containing the unsigned byte value
      */
     public static int getUnsignedByte(byte b) {
-               return (b > 0)? (int)b : (b & 0x7F | 0x80);
-       }
+        return (b > 0)? (int)b : (b & 0x7F | 0x80);
+    }
 
     /**
      * Return the unsigned value of the passed short variable
@@ -379,7 +379,7 @@ public abstract class NetUtils {
      * @param s the short value
      * @return the int variable containing the unsigned short value
      */
-       public static int getUnsignedShort(short s) {
-               return (s > 0)? (int)s : (s & 0x7FFF | 0x8000);
-       }
+    public static int getUnsignedShort(short s) {
+        return (s > 0)? (int)s : (s & 0x7FFF | 0x8000);
+    }
 }