Commit f333a4d57b2166738a7b546674113e016e2a177e
1 parent
3665f896
Exists in
master
Adição do javadoc
Showing
1 changed file
with
22 additions
and
2 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/message/DefaultMessage.java
@@ -41,6 +41,9 @@ import br.gov.frameworkdemoiselle.util.ResourceBundle; | @@ -41,6 +41,9 @@ import br.gov.frameworkdemoiselle.util.ResourceBundle; | ||
41 | import br.gov.frameworkdemoiselle.util.Strings; | 41 | import br.gov.frameworkdemoiselle.util.Strings; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | + * An implementation of the Message that uses resource files the application for | ||
45 | + * obtaining the description of the messages. | ||
46 | + * | ||
44 | * @author SERPRO | 47 | * @author SERPRO |
45 | */ | 48 | */ |
46 | public class DefaultMessage implements Message { | 49 | public class DefaultMessage implements Message { |
@@ -57,6 +60,14 @@ public class DefaultMessage implements Message { | @@ -57,6 +60,14 @@ public class DefaultMessage implements Message { | ||
57 | 60 | ||
58 | public static final SeverityType DEFAULT_SEVERITY = SeverityType.INFO; | 61 | public static final SeverityType DEFAULT_SEVERITY = SeverityType.INFO; |
59 | 62 | ||
63 | + /** | ||
64 | + * Create a new DefaultMessage with text, severity and parameters. | ||
65 | + * | ||
66 | + * @param text: the text of the message. | ||
67 | + * @param severity: represents the kind of message. | ||
68 | + * @param params: parameters of the message. | ||
69 | + * | ||
70 | + * */ | ||
60 | public DefaultMessage(String text, SeverityType severity, Object... params) { | 71 | public DefaultMessage(String text, SeverityType severity, Object... params) { |
61 | this.originalText = text; | 72 | this.originalText = text; |
62 | this.severity = (severity == null ? DEFAULT_SEVERITY : severity); | 73 | this.severity = (severity == null ? DEFAULT_SEVERITY : severity); |
@@ -66,6 +77,13 @@ public class DefaultMessage implements Message { | @@ -66,6 +77,13 @@ public class DefaultMessage implements Message { | ||
66 | initParsedText(); | 77 | initParsedText(); |
67 | } | 78 | } |
68 | 79 | ||
80 | + /** | ||
81 | + * Create a new DefaultMessage with text and parameters. | ||
82 | + * | ||
83 | + * @param text: the text of the message. | ||
84 | + * @param params: parameters of the message. | ||
85 | + * | ||
86 | + * */ | ||
69 | public DefaultMessage(String text, Object... params) { | 87 | public DefaultMessage(String text, Object... params) { |
70 | this(text, null, (Object[]) params); | 88 | this(text, null, (Object[]) params); |
71 | } | 89 | } |
@@ -98,8 +116,10 @@ public class DefaultMessage implements Message { | @@ -98,8 +116,10 @@ public class DefaultMessage implements Message { | ||
98 | public int hashCode() { | 116 | public int hashCode() { |
99 | final int prime = 31; | 117 | final int prime = 31; |
100 | int result = 1; | 118 | int result = 1; |
101 | - result = prime * result + ((parsedText == null) ? 0 : parsedText.hashCode()); | ||
102 | - result = prime * result + ((severity == null) ? 0 : severity.hashCode()); | 119 | + result = prime * result |
120 | + + ((parsedText == null) ? 0 : parsedText.hashCode()); | ||
121 | + result = prime * result | ||
122 | + + ((severity == null) ? 0 : severity.hashCode()); | ||
103 | return result; | 123 | return result; |
104 | } | 124 | } |
105 | 125 |