com.antelmann.db
Class Keyword
java.lang.Object
com.antelmann.db.AbstractDBEntry
com.antelmann.db.Keyword
- All Implemented Interfaces:
- DBEntry, Tag, Serializable, Comparable<Keyword>
- Direct Known Subclasses:
- GTag
public class Keyword
- extends AbstractDBEntry
- implements Tag, Comparable<Keyword>
implements a Group/Tag solely based on a String that also represents the ID for the DBEntry it is.
To easily be able to handle subclasses (as there may be multiple groups in an application), a
convenience method is provided (createNewTag(Class, Object)) that assumes that
subclasses also have a constructor that takes a single String or a single Object.
- Since:
- 07.11.2008, 12:02:14
- Author:
- Holger Antelmann
- See Also:
TaggableMapping,
Serialized Form
Keyword
public Keyword(Object name)
Keyword
public Keyword(String name)
getTagName
public String getTagName()
- Specified by:
getTagName in interface Tag
compareTo
public int compareTo(Keyword kw)
- Specified by:
compareTo in interface Comparable<Keyword>
toString
public String toString()
- Overrides:
toString in class AbstractDBEntry
removeAllTags
public static <T extends Keyword> void removeAllTags(Taggable<T> entry)
createNewTag
public static <T extends Keyword> T createNewTag(Class<T> type,
Object idAndName)
- allows to easily construct subclasses of Keyword assuming that these classes have
a constructor taking a single Object argument - just as Keyword itself.
- Type Parameters:
T - the type that is to be created- Parameters:
type - specifies the class used to construct the new instanceidAndName - the String that is passed to the constructor
- Returns:
- a new instance of type T based on reflection
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads