001/* 002 * (C) Copyright 2007 Nuxeo SAS (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Nuxeo - initial API and implementation 016 * 017 * $Id$ 018 */ 019 020package org.nuxeo.ecm.platform.ui.web.directory; 021 022import java.io.Serializable; 023 024/** 025 * @author <a href="mailto:glefter@nuxeo.com">George Lefter</a> This class is used for setting the values of a select 026 * box dynamically, i.e. not from a directory. 027 */ 028public class VocabularyEntry implements Serializable { 029 030 private static final long serialVersionUID = 8242013595942264323L; 031 032 private String id; 033 034 private String label; 035 036 private String parent; 037 038 private Boolean obsolete; 039 040 private Integer ordering; 041 042 public VocabularyEntry(String id, String label) { 043 this(id, label, null); 044 } 045 046 public VocabularyEntry(String id, String label, String parent) { 047 if (id == null) { 048 throw new IllegalArgumentException("id is null"); 049 } 050 if (label == null) { 051 throw new IllegalArgumentException("label is null"); 052 } 053 this.id = id; 054 this.label = label; 055 this.parent = parent; 056 } 057 058 public String getId() { 059 return id; 060 } 061 062 public void setId(String id) { 063 this.id = id; 064 } 065 066 public String getLabel() { 067 return label; 068 } 069 070 public void setLabel(String label) { 071 this.label = label; 072 } 073 074 public String getParent() { 075 return parent; 076 } 077 078 public void setParent(String parent) { 079 this.parent = parent; 080 } 081 082 /** 083 * @return Returns the obsolete. 084 */ 085 public Boolean getObsolete() { 086 return obsolete; 087 } 088 089 /** 090 * @param obsolete The obsolete to set. 091 */ 092 public void setObsolete(Boolean obsolete) { 093 this.obsolete = obsolete; 094 } 095 096 /** 097 * @return Returns the vocabulary entry order. 098 */ 099 public Integer getOrdering() { 100 return ordering; 101 } 102 103 /** 104 * This method sets the vocabulary entry order. 105 * 106 * @param ordering The order to set. 107 */ 108 public void setOrdering(Integer ordering) { 109 this.ordering = ordering; 110 } 111 112}