@Test public void testEquals() { Variable variable1 = new Variable(NAME, Variable.VariableType.PROCESS, DATA_TYPE, CUSTOM_DATA_TYPE, TAGS); assertTrue(variable1.equals(variable1)); Variable variable2 = new Variable(null); assertFalse(variable2.equals(new Object())); Variable variable3 = new Variable(Variable.VariableType.PROCESS); Variable otherVariable3 = new Variable(Variable.VariableType.INPUT); assertFalse(variable3.equals(otherVariable3)); Variable variable4 = new Variable(NAME, null); Variable otherVariable4 = new Variable("Other Name", null); assertFalse(variable4.equals(otherVariable4)); Variable variable5 = new Variable(null, null, null, null); Variable otherVariable5 = new Variable(NAME, null); assertFalse(variable5.equals(otherVariable5)); Variable variable6 = new Variable(null, null, DATA_TYPE, null); Variable otherVariable6 = new Variable(null, null, "Object", null); assertFalse(variable6.equals(otherVariable6)); Variable variable7 = new Variable(null, null, null, null); Variable otherVariable7 = new Variable(null, null, DATA_TYPE, null); assertFalse(variable7.equals(otherVariable7)); Variable variable8 = new Variable(null, null, null, null); Variable otherVariable8 = new Variable(null, null, "", null); assertTrue(variable8.equals(otherVariable8)); Variable variable9 = new Variable(null, null, null, CUSTOM_DATA_TYPE); Variable otherVariable9 = new Variable(null, null, null, "Other Custom Data Type"); assertFalse(variable9.equals(otherVariable9)); Variable variable10 = new Variable(null, null, null, null); Variable otherVariable10 = new Variable(null, null, null, CUSTOM_DATA_TYPE); assertFalse(variable10.equals(otherVariable10)); Variable variable11 = new Variable(null, null, null, null); Variable otherVariable11 = new Variable(null, null, null, ""); assertTrue(variable11.equals(otherVariable11)); Variable variable12 = new Variable(null, null, null, null, TAGS); Variable otherVariable12 = new Variable(null, null, null, null, OTHER_TAGS); assertFalse(variable12.equals(otherVariable12)); Variable variable13 = new Variable(null, null, null, null, null); Variable otherVariable13 = new Variable(null, null, null, null, TAGS); assertFalse(variable13.equals(otherVariable13)); Variable variable14 = new Variable(null, null, null, null, new ArrayList<>()); Variable otherVariable14 = new Variable(null, null, null, null, TAGS); assertFalse(variable14.equals(otherVariable14)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Variable)) { return false; } Variable variable = (Variable) o; if (getVariableType() != variable.getVariableType()) { return false; } if (!StringUtils.isEmpty(getName()) ? !getName().equals(variable.getName()) : !StringUtils.isEmpty(variable.getName())) { return false; } if (!StringUtils.isEmpty(getDataType()) ? !getDataType().equals(variable.getDataType()) : !StringUtils.isEmpty(variable.getDataType())) { return false; } if (!StringUtils.isEmpty(getCustomDataType()) ? !getCustomDataType().equals(variable.getCustomDataType()) : !StringUtils.isEmpty(variable.getCustomDataType())) { return false; } return tags != null && !tags.isEmpty() ? tags.equals(variable.tags) : variable.getTags() == null || variable.getTags().isEmpty(); }
Variable { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Variable)) { return false; } Variable variable = (Variable) o; if (getVariableType() != variable.getVariableType()) { return false; } if (!StringUtils.isEmpty(getName()) ? !getName().equals(variable.getName()) : !StringUtils.isEmpty(variable.getName())) { return false; } if (!StringUtils.isEmpty(getDataType()) ? !getDataType().equals(variable.getDataType()) : !StringUtils.isEmpty(variable.getDataType())) { return false; } if (!StringUtils.isEmpty(getCustomDataType()) ? !getCustomDataType().equals(variable.getCustomDataType()) : !StringUtils.isEmpty(variable.getCustomDataType())) { return false; } return tags != null && !tags.isEmpty() ? tags.equals(variable.tags) : variable.getTags() == null || variable.getTags().isEmpty(); } }
Variable { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Variable)) { return false; } Variable variable = (Variable) o; if (getVariableType() != variable.getVariableType()) { return false; } if (!StringUtils.isEmpty(getName()) ? !getName().equals(variable.getName()) : !StringUtils.isEmpty(variable.getName())) { return false; } if (!StringUtils.isEmpty(getDataType()) ? !getDataType().equals(variable.getDataType()) : !StringUtils.isEmpty(variable.getDataType())) { return false; } if (!StringUtils.isEmpty(getCustomDataType()) ? !getCustomDataType().equals(variable.getCustomDataType()) : !StringUtils.isEmpty(variable.getCustomDataType())) { return false; } return tags != null && !tags.isEmpty() ? tags.equals(variable.tags) : variable.getTags() == null || variable.getTags().isEmpty(); } Variable(VariableType variableType);  Variable(final String name,
                    final VariableType variableType);  Variable(final String name,
                    final VariableType variableType,
                    final String dataType,
                    final String customDataType);  Variable(final String name,
                    final VariableType variableType,
                    final String dataType,
                    final String customDataType,
                    final List<String> tags); }
Variable { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Variable)) { return false; } Variable variable = (Variable) o; if (getVariableType() != variable.getVariableType()) { return false; } if (!StringUtils.isEmpty(getName()) ? !getName().equals(variable.getName()) : !StringUtils.isEmpty(variable.getName())) { return false; } if (!StringUtils.isEmpty(getDataType()) ? !getDataType().equals(variable.getDataType()) : !StringUtils.isEmpty(variable.getDataType())) { return false; } if (!StringUtils.isEmpty(getCustomDataType()) ? !getCustomDataType().equals(variable.getCustomDataType()) : !StringUtils.isEmpty(variable.getCustomDataType())) { return false; } return tags != null && !tags.isEmpty() ? tags.equals(variable.tags) : variable.getTags() == null || variable.getTags().isEmpty(); } Variable(VariableType variableType);  Variable(final String name,
                    final VariableType variableType);  Variable(final String name,
                    final VariableType variableType,
                    final String dataType,
                    final String customDataType);  Variable(final String name,
                    final VariableType variableType,
                    final String dataType,
                    final String customDataType,
                    final List<String> tags); List<String> getTags(); void setTags(List<String> tags); VariableType getVariableType(); void setVariableType(final VariableType variableType); String getName(); void setName(final String name); String getDataType(); void setDataType(final String dataType); String getCustomDataType(); void setCustomDataType(final String customDataType); String toString(); static Variable deserialize(final String s,
                                       final VariableType variableType,
                                       final List<String> dataTypes); static Variable deserialize(final String s,
                                       final VariableType variableType); @Override boolean equals(final Object o); @Override int hashCode(); }
Variable { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Variable)) { return false; } Variable variable = (Variable) o; if (getVariableType() != variable.getVariableType()) { return false; } if (!StringUtils.isEmpty(getName()) ? !getName().equals(variable.getName()) : !StringUtils.isEmpty(variable.getName())) { return false; } if (!StringUtils.isEmpty(getDataType()) ? !getDataType().equals(variable.getDataType()) : !StringUtils.isEmpty(variable.getDataType())) { return false; } if (!StringUtils.isEmpty(getCustomDataType()) ? !getCustomDataType().equals(variable.getCustomDataType()) : !StringUtils.isEmpty(variable.getCustomDataType())) { return false; } return tags != null && !tags.isEmpty() ? tags.equals(variable.tags) : variable.getTags() == null || variable.getTags().isEmpty(); } Variable(VariableType variableType);  Variable(final String name,
                    final VariableType variableType);  Variable(final String name,
                    final VariableType variableType,
                    final String dataType,
                    final String customDataType);  Variable(final String name,
                    final VariableType variableType,
                    final String dataType,
                    final String customDataType,
                    final List<String> tags); List<String> getTags(); void setTags(List<String> tags); VariableType getVariableType(); void setVariableType(final VariableType variableType); String getName(); void setName(final String name); String getDataType(); void setDataType(final String dataType); String getCustomDataType(); void setCustomDataType(final String customDataType); String toString(); static Variable deserialize(final String s,
                                       final VariableType variableType,
                                       final List<String> dataTypes); static Variable deserialize(final String s,
                                       final VariableType variableType); @Override boolean equals(final Object o); @Override int hashCode();  }