1 19 20 21 package org.netbeans.core.windows.persistence; 22 23 24 25 26 27 33 public class GroupConfig { 34 35 36 public String name; 37 38 39 public boolean opened; 40 41 42 43 public TCGroupConfig[] tcGroupConfigs; 44 45 46 public GroupConfig() { 47 name = ""; tcGroupConfigs = new TCGroupConfig[0]; 49 } 50 51 public boolean equals (Object obj) { 52 if (this == obj) { 53 return true; 54 } 55 if (!(obj instanceof GroupConfig)) { 56 return false; 57 } 58 GroupConfig groupCfg = (GroupConfig) obj; 59 if (!name.equals(groupCfg.name)) { 60 return false; 61 } 62 if (opened != groupCfg.opened) { 63 return false; 64 } 65 if (tcGroupConfigs.length != groupCfg.tcGroupConfigs.length) { 67 return false; 68 } 69 for (int i = 0; i < tcGroupConfigs.length; i++) { 70 TCGroupConfig tcGroupCfg = null; 71 for (int j = 0; j < groupCfg.tcGroupConfigs.length; j++) { 72 if (tcGroupConfigs[i].tc_id.equals(groupCfg.tcGroupConfigs[j].tc_id)) { 73 tcGroupCfg = groupCfg.tcGroupConfigs[j]; 74 break; 75 } 76 } 77 if (tcGroupCfg == null) { 78 return false; 79 } 80 if (!tcGroupConfigs[i].equals(tcGroupCfg)) { 81 return false; 82 } 83 } 84 return true; 85 } 86 87 public int hashCode() { 88 int hash = 17; 89 hash = 37 * hash + name.hashCode(); 90 hash = 37 * hash + (opened ? 0 : 1); 91 for (int i = 0; i < tcGroupConfigs.length; i++) { 92 hash = 37 * hash + tcGroupConfigs[i].hashCode(); 93 } 94 return hash; 95 } 96 97 } 98 | Popular Tags |