4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
SugBooleanAttribute.java
Go to the documentation of this file.
1 /*
2  * Project: Server for annotations sharing
3  * Author: Ing. Jaroslav Dytrych idytrych@fit.vutbr.cz
4  * File: SugBooleanAttribute.java
5  * Description: Class representing attribute of type Boolean for prupose of suggestion
6  */
7 
8 package cz.vutbr.fit.knot.annotations.modules.suggestionManager.attributes;
9 
11 import javax.persistence.DiscriminatorValue;
12 import javax.persistence.Entity;
13 import javax.persistence.NamedQueries;
14 import javax.persistence.NamedQuery;
15 
16 /**
17  * @file SugBooleanAttribute.java
18  *
19  * @brief Class representing attribute of type Boolean for prupose of suggestion
20  */
21 
22 /**
23  * Class representing attribute of type Boolean for prupose of suggestion
24  *
25  * @brief Class representing attribute of type Boolean for prupose of suggestion
26  */
27 @Entity
28 @DiscriminatorValue("Boolean")
29 @NamedQueries({
30  @NamedQuery(name = "SuggestionAttribute.findByBoolVAlue", query = "SELECT a FROM SuggestionAttribute a WHERE a.boolVAlue = :boolVAlue"),
31 })
32 public class SugBooleanAttribute extends SugBaseAttribute {
33  /**
34  * Sets value of the attribute. Value should already be a native java Boolean value.
35  *
36  * @param value new value of the attribute
37  */
38  @Override
39  public void setValue(Object value) {
40  this.boolVAlue = (Boolean) value;
41  }
42 
43  /**
44  * Gets value of the attribute
45  *
46  * @return value of the attribute
47  */
48  @Override
49  public Object getValue() {
50  return boolVAlue;
51  }
52 
53  /**
54  * Parses provided value and sets that value as a value of attribute
55  *
56  * @param value new value of the attribute in raw form from XML
57  */
58  @Override
59  public void setRawValue(String value) throws IllegalArgumentException {
60  this.boolVAlue = Boolean.parseBoolean(value);
61  }
62 
63  /**
64  * Gets URI addres in ontology for this type of attribute
65  *
66  * @return Return URI addres in ontology for this type of attribute.
67  */
68  @Override
69  public String getTypeOntologyUri(){
70  return Constants.BOOLEAN_URI;
71  }
72 }
Class representing attribute of type Boolean for prupose of suggestion.