1 23 24 package org.infoglue.cms.entities.management; 25 26 import java.util.LinkedHashMap ; 27 28 35 36 37 public class ContentTypeAttributeParameter 38 { 39 public static final int SINGLE_VALUE_TYPE = 0; 40 public static final int MULTI_VALUE_TYPE = 1; 41 42 private String id = ""; 43 private int type = SINGLE_VALUE_TYPE; 44 private LinkedHashMap contentTypeAttributeParameterValues = new LinkedHashMap (); 45 46 public ContentTypeAttributeParameter() 47 { 48 } 49 50 public String getId() 51 { 52 return this.id; 53 } 54 55 public void setId(String id) 56 { 57 this.id = id; 58 } 59 60 public int getType() 61 { 62 return this.type; 63 } 64 65 public void setType(int type) 66 { 67 this.type = type; 68 } 69 70 public void addContentTypeAttributeParameterValue(String key, ContentTypeAttributeParameterValue contentTypeAttributeParameterValue) 71 { 72 this.contentTypeAttributeParameterValues.put(key, contentTypeAttributeParameterValue); 73 if(this.contentTypeAttributeParameterValues.size() > 1) 74 this.type = MULTI_VALUE_TYPE; 75 } 76 77 public ContentTypeAttributeParameterValue getContentTypeAttributeParameterValue() 78 { 79 if(this.contentTypeAttributeParameterValues.values() != null && this.contentTypeAttributeParameterValues.values().toArray().length > 0) 80 return (ContentTypeAttributeParameterValue)this.contentTypeAttributeParameterValues.values().toArray()[0]; 81 else 82 return null; 83 } 84 85 public ContentTypeAttributeParameterValue getContentTypeAttributeParameterValue(String key) 86 { 87 if(this.contentTypeAttributeParameterValues.size() > 0) 88 return (ContentTypeAttributeParameterValue)this.contentTypeAttributeParameterValues.get(key); 89 else 90 return null; 91 } 92 93 public LinkedHashMap getContentTypeAttributeParameterValues() 94 { 95 return this.contentTypeAttributeParameterValues; 96 } 97 98 99 100 } | Popular Tags |