@Test public void testToString() { Variable variable1 = new Variable(null, Variable.VariableType.PROCESS); assertNull(variable1.toString()); Variable variable2 = new Variable("", Variable.VariableType.PROCESS); assertNull(variable2.toString()); Variable variable3 = new Variable(NAME, Variable.VariableType.PROCESS); String result3 = NAME + DIVIDER + DIVIDER; assertEquals(result3, variable3.toString()); Variable variable4 = new Variable(NAME, Variable.VariableType.PROCESS, null, ""); String result4 = NAME + DIVIDER + DIVIDER; assertEquals(result4, variable4.toString()); Variable variable5 = new Variable(NAME, Variable.VariableType.PROCESS, null, CUSTOM_DATA_TYPE); String result5 = NAME + DIVIDER + CUSTOM_DATA_TYPE + DIVIDER; assertEquals(result5, variable5.toString()); Variable variable6 = new Variable(NAME, Variable.VariableType.PROCESS, "", null); String result6 = NAME + DIVIDER + DIVIDER; assertEquals(result6, variable6.toString()); Variable variable7 = new Variable(NAME, Variable.VariableType.PROCESS, DATA_TYPE, null); String result7 = NAME + DIVIDER + DATA_TYPE + DIVIDER; assertEquals(result7, variable7.toString()); Variable variable8 = new Variable(NAME, Variable.VariableType.INPUT, null, null, TAGS); String result8 = NAME + DIVIDER + DIVIDER; assertEquals(result8, variable8.toString()); Variable variable9 = new Variable(NAME, Variable.VariableType.PROCESS, null, null, TAGS); String result9 = NAME + DIVIDER + DIVIDER + TAG_1 + TAG_DIVIDER + TAG_2 + TAG_DIVIDER + TAG_3; assertEquals(result9, variable9.toString()); }
public String toString() { if (name != null && !name.isEmpty()) { StringBuilder sb = new StringBuilder().append(name); sb.append(DIVIDER); if (customDataType != null && !customDataType.isEmpty()) { sb.append(customDataType); } else if (dataType != null && !dataType.isEmpty()) { sb.append(dataType); } sb.append(DIVIDER); if (this.getVariableType() == Variable.VariableType.PROCESS && tags != null) { sb.append(String.join(TAG_DIVIDER, tags)); } return sb.toString(); } return null; }
Variable { public String toString() { if (name != null && !name.isEmpty()) { StringBuilder sb = new StringBuilder().append(name); sb.append(DIVIDER); if (customDataType != null && !customDataType.isEmpty()) { sb.append(customDataType); } else if (dataType != null && !dataType.isEmpty()) { sb.append(dataType); } sb.append(DIVIDER); if (this.getVariableType() == Variable.VariableType.PROCESS && tags != null) { sb.append(String.join(TAG_DIVIDER, tags)); } return sb.toString(); } return null; } }
Variable { public String toString() { if (name != null && !name.isEmpty()) { StringBuilder sb = new StringBuilder().append(name); sb.append(DIVIDER); if (customDataType != null && !customDataType.isEmpty()) { sb.append(customDataType); } else if (dataType != null && !dataType.isEmpty()) { sb.append(dataType); } sb.append(DIVIDER); if (this.getVariableType() == Variable.VariableType.PROCESS && tags != null) { sb.append(String.join(TAG_DIVIDER, tags)); } return sb.toString(); } return null; } 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 { public String toString() { if (name != null && !name.isEmpty()) { StringBuilder sb = new StringBuilder().append(name); sb.append(DIVIDER); if (customDataType != null && !customDataType.isEmpty()) { sb.append(customDataType); } else if (dataType != null && !dataType.isEmpty()) { sb.append(dataType); } sb.append(DIVIDER); if (this.getVariableType() == Variable.VariableType.PROCESS && tags != null) { sb.append(String.join(TAG_DIVIDER, tags)); } return sb.toString(); } return null; } 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 { public String toString() { if (name != null && !name.isEmpty()) { StringBuilder sb = new StringBuilder().append(name); sb.append(DIVIDER); if (customDataType != null && !customDataType.isEmpty()) { sb.append(customDataType); } else if (dataType != null && !dataType.isEmpty()) { sb.append(dataType); } sb.append(DIVIDER); if (this.getVariableType() == Variable.VariableType.PROCESS && tags != null) { sb.append(String.join(TAG_DIVIDER, tags)); } return sb.toString(); } return null; } 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();  }