1 package org.apache.ojb.broker; 2 3 4 7 public class ProductGroupWithArray implements java.io.Serializable 8 { 9 10 11 public int getId() 12 { 13 return groupId; 14 } 15 16 17 public String toString() 18 { 19 String articles = ""; 20 if (allArticlesInGroup != null) 21 { 22 for (int i = 0; i < allArticlesInGroup.length; i++) 23 { 24 if (articles == "") 25 articles += "{" + allArticlesInGroup[i]; 26 else 27 articles += "," + allArticlesInGroup[i]; 28 } 29 articles += "}"; 30 } 31 return "----\n" 32 + "group Id: " 33 + groupId 34 + "\n" 35 + "name: " 36 + groupName 37 + "\n" 38 + "description: " 39 + description 40 + "\n" 41 + "articles in group: " 42 + articles; 43 } 44 45 46 public String getName() 47 { 48 return groupName; 49 } 50 51 52 private InterfaceArticle[] allArticlesInGroup; 53 54 private String description; 55 56 private int groupId; 57 58 private String groupName; 59 60 public ProductGroupWithArray() 61 { 62 } 63 64 public ProductGroupWithArray(int pGroupId, String pGroupName, String pDescription) 65 { 66 groupId = pGroupId; 67 groupName = pGroupName; 68 description = pDescription; 69 } 70 71 72 73 public void setId(int newValue) 74 { 75 groupId = newValue; 76 } 77 78 79 public InterfaceArticle[] getAllArticles() 80 { 81 return allArticlesInGroup; 82 } 83 87 public InterfaceArticle[] getAllArticlesInGroup() 88 { 89 return allArticlesInGroup; 90 } 91 92 96 public void setAllArticlesInGroup(InterfaceArticle[] allArticlesInGroup) 97 { 98 this.allArticlesInGroup = allArticlesInGroup; 99 } 100 101 105 public String getDescription() 106 { 107 return description; 108 } 109 110 114 public void setDescription(String description) 115 { 116 this.description = description; 117 } 118 119 123 public int getGroupId() 124 { 125 return groupId; 126 } 127 128 132 public void setGroupId(int groupId) 133 { 134 this.groupId = groupId; 135 } 136 137 141 public String getGroupName() 142 { 143 return groupName; 144 } 145 146 150 public void setGroupName(String groupName) 151 { 152 this.groupName = groupName; 153 } 154 155 } 156 | Popular Tags |