liblldp: final parameters
[controller.git] / opendaylight / commons / liblldp / src / main / java / org / opendaylight / controller / liblldp / LLDP.java
index bbee8599b62fe96d2643ae894b69dabbafc35f81..1b76c9980576aee902e795c084f22f199383deb5 100644 (file)
@@ -41,7 +41,7 @@ public class LLDP extends Packet {
     /**
      * Constructor that creates the tlvList LinkedHashMap and sets the write access for the same
      */
-    public LLDP(boolean writeAccess) {
+    public LLDP(final boolean writeAccess) {
         super(writeAccess);
         init();
     }
@@ -57,7 +57,7 @@ public class LLDP extends Packet {
      *            - description of the type of TLV
      * @return byte - type of TLV
      */
-    private byte getType(String typeDesc) {
+    private byte getType(final String typeDesc) {
         if (typeDesc.equals(CHASSISID)) {
             return LLDPTLV.TLVType.ChassisID.getValue();
         } else if (typeDesc.equals(PORTID)) {
@@ -71,7 +71,7 @@ public class LLDP extends Packet {
         }
     }
 
-    private LLDPTLV getFromTLVs(Byte type) {
+    private LLDPTLV getFromTLVs(final Byte type) {
         LLDPTLV tlv = null;
         tlv = mandatoryTLVs.get(type);
         if (tlv == null) {
@@ -94,11 +94,11 @@ public class LLDP extends Packet {
      *            - description of the type of TLV
      * @return LLDPTLV - full TLV
      */
-    public LLDPTLV getTLV(String type) {
+    public LLDPTLV getTLV(final String type) {
         return getFromTLVs(getType(type));
     }
 
-    public LLDPTLV getCustomTLV(CustomTLVKey key) {
+    public LLDPTLV getCustomTLV(final CustomTLVKey key) {
         return customTLVs.get(key);
     }
 
@@ -108,7 +108,7 @@ public class LLDP extends Packet {
      * @param tlv
      *            - tlv to set
      */
-    public void setTLV(String type, LLDPTLV tlv) {
+    public void setTLV(final String type, final LLDPTLV tlv) {
         putToTLVs(getType(type), tlv);
     }
 
@@ -123,7 +123,7 @@ public class LLDP extends Packet {
      * @param chassisId
      *            - the chassisId to set
      */
-    public LLDP setChassisId(LLDPTLV chassisId) {
+    public LLDP setChassisId(final LLDPTLV chassisId) {
         setTLV(CHASSISID, chassisId);
         return this;
     }
@@ -139,7 +139,7 @@ public class LLDP extends Packet {
      * @param systemNameId
      *            - the systemNameId to set
      */
-    public LLDP setSystemNameId(LLDPTLV systemNameId) {
+    public LLDP setSystemNameId(final LLDPTLV systemNameId) {
         setTLV(SYSTEMNAMEID, systemNameId);
         return this;
     }
@@ -156,7 +156,7 @@ public class LLDP extends Packet {
      *            - the portId to set
      * @return LLDP
      */
-    public LLDP setPortId(LLDPTLV portId) {
+    public LLDP setPortId(final LLDPTLV portId) {
         setTLV(PORTID, portId);
         return this;
     }
@@ -173,7 +173,7 @@ public class LLDP extends Packet {
      *            - the ttl to set
      * @return LLDP
      */
-    public LLDP setTtl(LLDPTLV ttl) {
+    public LLDP setTtl(final LLDPTLV ttl) {
         setTLV(TTL, ttl);
         return this;
     }
@@ -197,7 +197,7 @@ public class LLDP extends Packet {
      *            the optionalTLVList to set
      * @return LLDP
      */
-    public LLDP setOptionalTLVList(List<LLDPTLV> optionalTLVList) {
+    public LLDP setOptionalTLVList(final List<LLDPTLV> optionalTLVList) {
         for (LLDPTLV tlv : optionalTLVList) {
             optionalTLVs.put(tlv.getType(), tlv);
         }
@@ -218,7 +218,7 @@ public class LLDP extends Packet {
     }
 
     @Override
-    public Packet deserialize(byte[] data, int bitOffset, int size) throws PacketException {
+    public Packet deserialize(final byte[] data, final int bitOffset, final int size) throws PacketException {
         int lldpOffset = bitOffset; // LLDP start
         int lldpSize = size; // LLDP size
 
@@ -257,7 +257,7 @@ public class LLDP extends Packet {
             int numBits = tlv.getTLVSize();
             try {
                 BitBufferHelper.setBytes(serializedBytes, tlv.serialize(), startOffset, numBits);
-            } catch (BufferException e) {
+            } catch (final BufferException e) {
                 throw new PacketException(e.getMessage());
             }
             startOffset += numBits;
@@ -266,7 +266,7 @@ public class LLDP extends Packet {
         try {
             BitBufferHelper.setBytes(serializedBytes, LLDP.emptyTLV.serialize(), startOffset,
                     LLDP.emptyTLV.getTLVSize());
-        } catch (BufferException e) {
+        } catch (final BufferException e) {
             throw new PacketException(e.getMessage());
         }