001/* 002 * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. 003 * Copyright (C) 2000-2010 The Gridarta Developers. 004 * 005 * This program is free software; you can redistribute it and/or modify 006 * it under the terms of the GNU General Public License as published by 007 * the Free Software Foundation; either version 2 of the License, or 008 * (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU General Public License along 016 * with this program; if not, write to the Free Software Foundation, Inc., 017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 018 */ 019 020package net.sf.gridarta.model.archetypetype; 021 022import org.jetbrains.annotations.NotNull; 023 024/** 025 * An {@link ArchetypeAttribute} suitable for unit tests. 026 * @author Andreas Kirschbaum 027 */ 028public class TestArchetypeAttribute extends ArchetypeAttribute { 029 030 /** 031 * The attribute's type. 032 */ 033 @NotNull 034 private final String type; 035 036 /** 037 * Creates a new instance. 038 * @param type the attribute's type 039 * @param archetypeAttributeName the archetype attribute name 040 * @param attributeName the user interface attribute name 041 * @param description the attribute's description 042 * @param inputLength the input length in characters for text input fields 043 */ 044 public TestArchetypeAttribute(@NotNull final String type, @NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) { 045 super(archetypeAttributeName, attributeName, description, inputLength); 046 this.type = type; 047 } 048 049 /** 050 * {@inheritDoc} 051 */ 052 @NotNull 053 @Override 054 public String toString() { 055 return type + "/" + super.toString(); 056 } 057 058 /** 059 * {@inheritDoc} 060 */ 061 @Override 062 public void visit(@NotNull final ArchetypeAttributeVisitor visitor) { 063 throw new AssertionError(); 064 } 065 066}