001/* 002 * (C) Copyright 2007 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Nuxeo - initial API and implementation 018 * 019 * $Id$ 020 */ 021 022package org.nuxeo.ecm.platform.ui.web.directory; 023 024import java.io.Serializable; 025 026/** 027 * @author <a href="mailto:[email protected]">George Lefter</a> This class is used for setting the values of a select 028 * box dynamically, i.e. not from a directory. 029 */ 030public class VocabularyEntry implements Serializable { 031 032 private static final long serialVersionUID = 8242013595942264323L; 033 034 private String id; 035 036 private String label; 037 038 private String parent; 039 040 private Boolean obsolete; 041 042 private Integer ordering; 043 044 public VocabularyEntry(String id, String label) { 045 this(id, label, null); 046 } 047 048 public VocabularyEntry(String id, String label, String parent) { 049 if (id == null) { 050 throw new IllegalArgumentException("id is null"); 051 } 052 if (label == null) { 053 throw new IllegalArgumentException("label is null"); 054 } 055 this.id = id; 056 this.label = label; 057 this.parent = parent; 058 } 059 060 public String getId() { 061 return id; 062 } 063 064 public void setId(String id) { 065 this.id = id; 066 } 067 068 public String getLabel() { 069 return label; 070 } 071 072 public void setLabel(String label) { 073 this.label = label; 074 } 075 076 public String getParent() { 077 return parent; 078 } 079 080 public void setParent(String parent) { 081 this.parent = parent; 082 } 083 084 /** 085 * @return Returns the obsolete. 086 */ 087 public Boolean getObsolete() { 088 return obsolete; 089 } 090 091 /** 092 * @param obsolete The obsolete to set. 093 */ 094 public void setObsolete(Boolean obsolete) { 095 this.obsolete = obsolete; 096 } 097 098 /** 099 * @return Returns the vocabulary entry order. 100 */ 101 public Integer getOrdering() { 102 return ordering; 103 } 104 105 /** 106 * This method sets the vocabulary entry order. 107 * 108 * @param ordering The order to set. 109 */ 110 public void setOrdering(Integer ordering) { 111 this.ordering = ordering; 112 } 113 114}