Fix checkstyle violations in sal-common-api
[controller.git] / opendaylight / md-sal / sal-common-api / src / main / java / org / opendaylight / controller / md / sal / common / api / clustering / Entity.java
index 35f23a490b1ef44ab220ed17ee96684454d16f91..c97fe51d363dc39dc6d71365e410c1861a6a127f 100644 (file)
@@ -15,10 +15,9 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 /**
- * <p></p>
  * A clustered Entity is something which is shared by multiple applications across a cluster. An Entity has a type
  * and an identifier.
- * </p>
+ *
  * <p>
  * The type describes the type of the Entity where examples of a type maybe "openflow" or "netconf"
  * etc. An Entity type could be tied to how exactly an application shares and "owns" an entity. For example we may want
@@ -26,22 +25,25 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
  * first served basis. On the other hand for netconf entity types we may want applications to gain ownership based on
  * a load balancing approach. While this mechanism of assigning a ownership acquisition strategy is not finalized the
  * intention is that the entity type will play a role in determining the strategy and thus should be put in place.
- * </p>
+ *
  * <p>
  * The identifier is a YangInstanceIdentifier. The reason for the choice of YangInstanceIdentifier is because it
  * can easily be used to represent a data node. For example an inventory node represents a shared entity and it is best
  * referenced by the YangInstanceIdentifier if the inventory node is stored in the data store.
- * </p>
+ *
+ * <p>
  * Note that an entity identifier must conform to a valid yang schema. If there is no existing yang schema to
  * represent an entity, the general-entity yang model can be used.
- * <p>
- * </p>
+ *
+ * @deprecated Use org.opendaylight.mdsal.binding.api.clustering.Entity or
+ *             org.opendaylight.mdsal.eos.dom.api.DOMEntity instead
  */
+@Deprecated
 public final class Entity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    private static final QName ENTITY_QNAME =
-        org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.core.general.entity.rev150820.Entity.QNAME;
+    private static final QName ENTITY_QNAME = org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+            .controller.md.sal.core.general.entity.rev150820.Entity.QNAME;
     private static final QName ENTITY_NAME = QName.create(ENTITY_QNAME, "name");
 
     private final String type;
@@ -72,34 +74,32 @@ public final class Entity implements Serializable {
     }
 
     /**
-     *
-     * @return id of entity
+     * Returns the id of entity.
      */
     @Nonnull
-    public YangInstanceIdentifier getId(){
+    public YangInstanceIdentifier getId() {
         return id;
     }
 
     /**
-     *
-     * @return type of entity
+     * Returns the type of entity.
      */
     @Nonnull
-    public String getType(){
+    public String getType() {
         return type;
     }
 
     @Override
-    public boolean equals(Object o) {
-        if (this == o) {
+    public boolean equals(Object obj) {
+        if (this == obj) {
             return true;
         }
 
-        if (o == null || getClass() != o.getClass()) {
+        if (obj == null || getClass() != obj.getClass()) {
             return false;
         }
 
-        Entity entity = (Entity) o;
+        Entity entity = (Entity) obj;
 
         if (!id.equals(entity.id)) {
             return false;
@@ -119,10 +119,6 @@ public final class Entity implements Serializable {
 
     @Override
     public String toString() {
-        final StringBuilder sb = new StringBuilder("Entity{");
-        sb.append("type='").append(type).append('\'');
-        sb.append(", id=").append(id);
-        sb.append('}');
-        return sb.toString();
+        return "Entity{" + "type='" + type + '\'' + ", id=" + id + '}';
     }
 }