convenience methods to TaggedText and TagEnum
authorAndreas Müller <a.mueller@bgbm.org>
Wed, 11 Jan 2012 16:19:30 +0000 (16:19 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Wed, 11 Jan 2012 16:19:30 +0000 (16:19 +0000)
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/TagEnum.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/TaggedText.java

index 2bedb2722024854f466422ee3dbf712200f46aa8..06fbac3037e3653ab3e931c9d9066fe07b6bfe7f 100644 (file)
@@ -68,7 +68,40 @@ public enum TagEnum {
        /**
         *  The hybrid sign. 
         */
-       hybridSign,
+       hybridSign
+       ;
        
        
+       public boolean isName(){
+               return this == name;
+       }
+       public boolean isRank(){
+               return this == rank;
+       }
+       public boolean isAuthors(){
+               return this == authors;
+       }
+       public boolean isAppendedPhrase(){
+               return this == appendedPhrase;
+       }
+       public boolean isReference(){
+               return this == reference;
+       }
+       public boolean isYear(){
+               return this == year;
+       }
+       public boolean isFullName(){
+               return this == fullName;
+       }
+
+       public boolean isNomStatus(){
+               return this == nomStatus;
+       }
+       public boolean isSeparator(){
+               return this == separator;
+       }
+       public boolean isHybridSign(){
+               return this == hybridSign;
+       }
+
 }
index 3ce657ef89762ad2439a648f2bed4703db754ddb..ffea15d34923aaa094370f8d3e6a9db8a46d4d90 100644 (file)
@@ -49,6 +49,42 @@ public class TaggedText {
                this.text = text;
                this.type = type;
        }
+
+// *************************** DELEGATES ************************************/
+
+       public boolean isName() {
+               return type.isName();
+       }
+       public boolean isRank() {
+               return type.isRank();
+       }
+       public boolean isAuthors() {
+               return type.isAuthors();
+       }
+       public boolean isAppendedPhrase() {
+               return type.isAppendedPhrase();
+       }
+       public boolean isReference() {
+               return type.isReference();
+       }
+       public boolean isYear() {
+               return type.isYear();
+       }
+       public boolean isFullName() {
+               return type.isFullName();
+       }
+       public boolean isNomStatus() {
+               return type.isNomStatus();
+       }
+       public boolean isSeparator() {
+               return type.isSeparator();
+       }
+       public boolean isHybridSign() {
+               return type.isHybridSign();
+       }
+       
+       
+// ********************** toString() ***********************************************/  
        
        @Override
        public String toString(){