@Test public void testEquality() { Project g1 = new Project(); Project g2 = new Project(); assertTrue("null == null", g1.equals(g2)); g1 = new Project("name"); g2 = new Project("other"); assertFalse("\"name\" != \"other\"", g1.equals(g2)); g1 = new Project("name"); g2 = new Project("NAME"); assertTrue("\"name\" == \"NAME\"", g1.equals(g2)); assertTrue("\"name\" == \"name\"", g1.equals(g1)); assertTrue("\"NAME\" == \"NAME\"", g2.equals(g2)); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Project other = (Project) obj; int numNull = (name == null ? 1 : 0) + (other.name == null ? 1 : 0); switch (numNull) { case 0: return name.toUpperCase(Locale.ROOT).equals( other.name.toUpperCase(Locale.ROOT)); case 1: return false; default: return true; } }
Project implements Comparable<Project>, Nameable, Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Project other = (Project) obj; int numNull = (name == null ? 1 : 0) + (other.name == null ? 1 : 0); switch (numNull) { case 0: return name.toUpperCase(Locale.ROOT).equals( other.name.toUpperCase(Locale.ROOT)); case 1: return false; default: return true; } } }
Project implements Comparable<Project>, Nameable, Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Project other = (Project) obj; int numNull = (name == null ? 1 : 0) + (other.name == null ? 1 : 0); switch (numNull) { case 0: return name.toUpperCase(Locale.ROOT).equals( other.name.toUpperCase(Locale.ROOT)); case 1: return false; default: return true; } } Project();  Project(String name);  Project(String name, String path); }
Project implements Comparable<Project>, Nameable, Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Project other = (Project) obj; int numNull = (name == null ? 1 : 0) + (other.name == null ? 1 : 0); switch (numNull) { case 0: return name.toUpperCase(Locale.ROOT).equals( other.name.toUpperCase(Locale.ROOT)); case 1: return false; default: return true; } } Project();  Project(String name);  Project(String name, String path); @Override String getName(); String getPath(); boolean isIndexed(); String getId(); int getTabSize(); @Override void setName(String name); void setPath(String path); void setIndexed(boolean flag); void setTabSize(int tabSize); boolean hasTabSizeSetting(); boolean isNavigateWindowEnabled(); void setNavigateWindowEnabled(boolean navigateWindowEnabled); boolean isHandleRenamedFiles(); void setHandleRenamedFiles(boolean flag); boolean isHistoryEnabled(); void setHistoryEnabled(boolean flag); Set<Group> getGroups(); void setGroups(Set<Group> groups); void addGroup(Group group); final void completeWithDefaults(); static Project getProject(String path); static Project getProject(File file); static Project getByName(String name); @Override int compareTo(Project p2); @Override int hashCode(); @Override boolean equals(Object obj); }
Project implements Comparable<Project>, Nameable, Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Project other = (Project) obj; int numNull = (name == null ? 1 : 0) + (other.name == null ? 1 : 0); switch (numNull) { case 0: return name.toUpperCase(Locale.ROOT).equals( other.name.toUpperCase(Locale.ROOT)); case 1: return false; default: return true; } } Project();  Project(String name);  Project(String name, String path); @Override String getName(); String getPath(); boolean isIndexed(); String getId(); int getTabSize(); @Override void setName(String name); void setPath(String path); void setIndexed(boolean flag); void setTabSize(int tabSize); boolean hasTabSizeSetting(); boolean isNavigateWindowEnabled(); void setNavigateWindowEnabled(boolean navigateWindowEnabled); boolean isHandleRenamedFiles(); void setHandleRenamedFiles(boolean flag); boolean isHistoryEnabled(); void setHistoryEnabled(boolean flag); Set<Group> getGroups(); void setGroups(Set<Group> groups); void addGroup(Group group); final void completeWithDefaults(); static Project getProject(String path); static Project getProject(File file); static Project getByName(String name); @Override int compareTo(Project p2); @Override int hashCode(); @Override boolean equals(Object obj);  }