test_class.file: dataprep-upgrade-common/src/test/java/org/talend/dataprep/upgrade/model/UpgradeTaskIdTest.java
test_class.identifier: UpgradeTaskIdTest
test_case.body: @Test
      public void shouldEquals() throws Exception {
          UpgradeTaskId id1 = new UpgradeTaskId("1.2.0", "name", 1);
          UpgradeTaskId id2 = new UpgradeTaskId("1.2.0", "name", 1);
          assertEquals(0, id1.compareTo(id2));
      }
test_case.class_method_signature: UpgradeTaskIdTest.shouldEquals()
test_case.full_signature: @Test public void shouldEquals()
test_case.identifier: shouldEquals
test_case.invocations: assertEquals compareTo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldEquals()
focal_class.declarator: version
focal_class.modifier: private
focal_class.original_string: private String version;
focal_class.type: String
focal_class.var_name: version
focal_class.declarator: name
focal_class.modifier: private
focal_class.original_string: private String name;
focal_class.type: String
focal_class.var_name: name
focal_class.declarator: order
focal_class.modifier: private
focal_class.original_string: private int order;
focal_class.type: int
focal_class.var_name: order
focal_class.file: dataprep-upgrade-common/src/main/java/org/talend/dataprep/upgrade/model/UpgradeTaskId.java
focal_class.identifier: UpgradeTaskId
focal_class.interfaces: implements Comparable<UpgradeTaskId>
focal_class.class_method_signature: UpgradeTaskId.UpgradeTaskId()
focal_class.full_signature: public  UpgradeTaskId()
focal_class.identifier: UpgradeTaskId
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  UpgradeTaskId()
focal_class.class_method_signature: UpgradeTaskId.UpgradeTaskId(String version, String name, int order)
focal_class.full_signature: public  UpgradeTaskId(String version, String name, int order)
focal_class.identifier: UpgradeTaskId
focal_class.modifiers: public
focal_class.parameters: (String version, String name, int order)
focal_class.signature:  UpgradeTaskId(String version, String name, int order)
focal_class.class_method_signature: UpgradeTaskId.getVersion()
focal_class.full_signature: public String getVersion()
focal_class.identifier: getVersion
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getVersion()
focal_class.class_method_signature: UpgradeTaskId.setVersion(String version)
focal_class.full_signature: public void setVersion(String version)
focal_class.identifier: setVersion
focal_class.modifiers: public
focal_class.parameters: (String version)
focal_class.return: void
focal_class.signature: void setVersion(String version)
focal_class.class_method_signature: UpgradeTaskId.getName()
focal_class.full_signature: public String getName()
focal_class.identifier: getName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: UpgradeTaskId.setName(String name)
focal_class.full_signature: public void setName(String name)
focal_class.identifier: setName
focal_class.modifiers: public
focal_class.parameters: (String name)
focal_class.return: void
focal_class.signature: void setName(String name)
focal_class.class_method_signature: UpgradeTaskId.getOrder()
focal_class.full_signature: public int getOrder()
focal_class.identifier: getOrder
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getOrder()
focal_class.class_method_signature: UpgradeTaskId.setOrder(int order)
focal_class.full_signature: public void setOrder(int order)
focal_class.identifier: setOrder
focal_class.modifiers: public
focal_class.parameters: (int order)
focal_class.return: void
focal_class.signature: void setOrder(int order)
focal_class.class_method_signature: UpgradeTaskId.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: UpgradeTaskId.getUniqueKey()
focal_class.full_signature: public String getUniqueKey()
focal_class.identifier: getUniqueKey
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getUniqueKey()
focal_class.class_method_signature: UpgradeTaskId.compareTo(UpgradeTaskId other)
focal_class.full_signature: @Override public int compareTo(UpgradeTaskId other)
focal_class.identifier: compareTo
focal_class.modifiers: @Override public
focal_class.parameters: (UpgradeTaskId other)
focal_class.return: int
focal_class.signature: int compareTo(UpgradeTaskId other)
focal_class.class_method_signature: UpgradeTaskId.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: UpgradeTaskId.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_method.body: @Override
      public int compareTo(UpgradeTaskId other) {
  
          if (other == null) {
              return 1;
          }
  
          // compare version only if needed
          if (!StringUtils.equals(version, other.getVersion())) {
  
              // split with by '.'
              final String[] versionParts = version.split("\\.");
              final String[] otherVersionParts = other.getVersion().split("\\.");
  
              // compare each part with a left pad so that '1-PE' < '2-EE' < '100-PE'
              for (int i = 0; i < versionParts.length; i++) {
                  String currentPart = leftPad(versionParts[i], 6, '0');
  
                  // if there's no match for the other version, let's consider 0
                  String otherPart = "000000";
                  if (i < otherVersionParts.length) {
                      otherPart = leftPad(otherVersionParts[i], 6, '0');
                  }
  
                  final int result = currentPart.compareTo(otherPart);
                  if (result != 0) {
                      return result;
                  }
              }
          }
  
          // then order
          return Integer.compare(order, other.getOrder());
      }
focal_method.class_method_signature: UpgradeTaskId.compareTo(UpgradeTaskId other)
focal_method.full_signature: @Override public int compareTo(UpgradeTaskId other)
focal_method.identifier: compareTo
focal_method.invocations: equals getVersion split split getVersion leftPad leftPad compareTo compare getOrder
focal_method.modifiers: @Override public
focal_method.parameters: (UpgradeTaskId other)
focal_method.return: int
focal_method.signature: int compareTo(UpgradeTaskId other)