View Javadoc
1   package org.nuiton.eugene.models.extension.tagvalue;
2   
3   /*
4    * #%L
5    * EUGene :: EUGene
6    * %%
7    * Copyright (C) 2004 - 2014 CodeLutin
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser General Public License as
11   * published by the Free Software Foundation, either version 3 of the
12   * License, or (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Lesser Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Lesser Public
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
22   * #L%
23   */
24  
25  import java.util.Map;
26  import java.util.Set;
27  
28  /**
29   * Created on 4/26/14.
30   *
31   * @author Tony Chemit - chemit@codelutin.com
32   * @since 2.9
33   */
34  public interface WithTagValuesOrStereotypes {
35  
36      boolean hasStereotype(String stereotypeName);
37  
38      Set<String> getStereotypes();
39  
40      void addStereotype(String stereotypeName);
41  
42      void removeStereotype(String stereotypeName);
43  
44      /**
45       * Returns the tagValues associated with this element.
46       * For each entry, the key is the name of the tagValue, the value is the value of the tagValue :-)
47       *
48       * @return a Map containing all tagValues associated with this element
49       */
50      Map<String, String> getTagValues();
51  
52      /**
53       * Returns the tagValue corresponding to the given name, or null if the element has no associated tagValue for this name.
54       *
55       * @param tagValue tag value key
56       * @return the value of the found tagValue, or null if the element has no associated tagValue for this name.
57       */
58      String getTagValue(String tagValue);
59  
60      /**
61       * Adds the given {@code value} associated to the {@code tagValue}.
62       *
63       * Note: If a previous tag value was definied, then it will be replaced.
64       *
65       * @param tagValue the name of the tag value
66       * @param value    the value to associate
67       * @since 2.1.2
68       */
69      void addTagValue(String tagValue, String value);
70  
71      /**
72       * Returns whether this element has a tagValue corresponding to the given name, or not.
73       *
74       * @param tagValue tag value name
75       * @return a boolean indicating whether this element has a tagValue corresponding to the given name, or not.
76       */
77      boolean hasTagValue(String tagValue);
78  
79      void removeTagValue(String tagvalue);
80  
81  }