@Test public void testEquals() { AssignmentData data = new AssignmentData(); Variable v1 = new Variable("processVar", PROCESS); Variable v2 = new Variable("variable2", PROCESS); data.addVariable(v1); Assignment tested = new Assignment(data, "varName", OUTPUT, v1.getName(), null); assertNotEquals(tested, new Object()); assertEquals(tested, tested); Assignment b = new Assignment(data, "varName2", OUTPUT, v1.getName(), null); assertNotEquals(tested, b); b = new Assignment(data, "varName", OUTPUT, "processVar", null); assertEquals(tested, b); b.setProcessVarName(null); assertNotEquals(tested, b); tested.setProcessVarName(null); assertEquals(tested, b); b.setExpression("#{expression}"); assertNotEquals(tested, b); tested.setExpression("#{expression}"); assertEquals(tested, b); v1 = new Variable("processVar", PROCESS, "String", null, null); v2 = new Variable("processVar", PROCESS, "String", null, null); assertEquals(v1, v2); v2 = new Variable("processVar", PROCESS, "String", null, Arrays.asList("internal", "input")); assertNotEquals(v1, v2); v1 = new Variable("processVar", PROCESS, "String", null, Arrays.asList("internal", "input")); assertEquals(v1, v2); v2 = new Variable("processVar", PROCESS, "String", null, null); assertNotEquals(v1, v2); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Assignment)) { return false; } Assignment that = (Assignment) o; return Objects.equals(expression, that.expression) && Objects.equals(variable, that.variable) && Objects.equals(processVar, that.processVar); }
Assignment { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Assignment)) { return false; } Assignment that = (Assignment) o; return Objects.equals(expression, that.expression) && Objects.equals(variable, that.variable) && Objects.equals(processVar, that.processVar); } }
Assignment { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Assignment)) { return false; } Assignment that = (Assignment) o; return Objects.equals(expression, that.expression) && Objects.equals(variable, that.variable) && Objects.equals(processVar, that.processVar); } Assignment();  Assignment(final AssignmentData assignmentData,
                      final String variableName,
                      final Variable.VariableType variableType,
                      final String dataType,
                      final String customDataType,
                      final String processVarName,
                      final String expression);  Assignment(final AssignmentData assignmentData,
                      final String variableName,
                      final Variable.VariableType variableType,
                      final String processVarName,
                      final String expression); }
Assignment { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Assignment)) { return false; } Assignment that = (Assignment) o; return Objects.equals(expression, that.expression) && Objects.equals(variable, that.variable) && Objects.equals(processVar, that.processVar); } Assignment();  Assignment(final AssignmentData assignmentData,
                      final String variableName,
                      final Variable.VariableType variableType,
                      final String dataType,
                      final String customDataType,
                      final String processVarName,
                      final String expression);  Assignment(final AssignmentData assignmentData,
                      final String variableName,
                      final Variable.VariableType variableType,
                      final String processVarName,
                      final String expression); String getName(); void setName(final String name); Variable.VariableType getVariableType(); void setVariableType(final Variable.VariableType variableType); Variable getVariable(); String getDataType(); void setDataType(final String dataType); String getCustomDataType(); void setCustomDataType(final String customDataType); String getProcessVarName(); void setProcessVarName(final String processVarName); String getExpression(); void setExpression(final String expression); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static Assignment deserialize(final AssignmentData assignmentData,
                                         String sAssignment); }
Assignment { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Assignment)) { return false; } Assignment that = (Assignment) o; return Objects.equals(expression, that.expression) && Objects.equals(variable, that.variable) && Objects.equals(processVar, that.processVar); } Assignment();  Assignment(final AssignmentData assignmentData,
                      final String variableName,
                      final Variable.VariableType variableType,
                      final String dataType,
                      final String customDataType,
                      final String processVarName,
                      final String expression);  Assignment(final AssignmentData assignmentData,
                      final String variableName,
                      final Variable.VariableType variableType,
                      final String processVarName,
                      final String expression); String getName(); void setName(final String name); Variable.VariableType getVariableType(); void setVariableType(final Variable.VariableType variableType); Variable getVariable(); String getDataType(); void setDataType(final String dataType); String getCustomDataType(); void setCustomDataType(final String customDataType); String getProcessVarName(); void setProcessVarName(final String processVarName); String getExpression(); void setExpression(final String expression); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static Assignment deserialize(final AssignmentData assignmentData,
                                         String sAssignment);  }