001/**
002 * Copyright 2005-2018 The Kuali Foundation
003 *
004 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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 */
016package org.kuali.rice.kns.datadictionary;
017
018import org.apache.commons.lang.StringUtils;
019import org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase;
020
021/**
022 * Abstract superclass for all maintainable fields and collections.  Never used directly.
023 *
024 * @deprecated Use {@link org.kuali.rice.krad.uif.field.Field} subclasses.
025 */
026@Deprecated
027public abstract class MaintainableItemDefinition extends DataDictionaryDefinitionBase {
028    private static final long serialVersionUID = 4564613758722159747L;
029    
030        private String name;
031
032    public MaintainableItemDefinition() {
033    }
034
035
036    /**
037     * @return name
038     */
039    public String getName() {
040        return name;
041    }
042
043    /**
044     * Sets name to the given value.
045     * 
046     * @param name
047     * @throws IllegalArgumentException if the given name is blank
048     */
049    public void setName(String name) {
050        if (StringUtils.isBlank(name)) {
051            throw new IllegalArgumentException("invalid (blank) name");
052        }
053        this.name = name;
054    }
055
056
057    /**
058     * @see java.lang.Object#toString()
059     */
060    public String toString() {
061        return "MaintainableItemDefinition for item " + getName();
062    }
063}