projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Gradle build file
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
text
/
PlainTextPart.java
diff --git
a/src/main/java/net/pterodactylus/sone/text/PlainTextPart.java
b/src/main/java/net/pterodactylus/sone/text/PlainTextPart.java
index
4f15a73
..
7bdbee9
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/text/PlainTextPart.java
+++ b/
src/main/java/net/pterodactylus/sone/text/PlainTextPart.java
@@
-17,6
+17,10
@@
package net.pterodactylus.sone.text;
package net.pterodactylus.sone.text;
+import java.util.Objects;
+
+import javax.annotation.Nonnull;
+
/**
* {@link Part} implementation that holds a single piece of text.
*
/**
* {@link Part} implementation that holds a single piece of text.
*
@@
-24,29
+28,14
@@
package net.pterodactylus.sone.text;
*/
public class PlainTextPart implements Part {
*/
public class PlainTextPart implements Part {
- /** The text of the part. */
private final String text;
private final String text;
- /**
- * Creates a new plain-text part.
- *
- * @param text
- * The text of the part
- */
- public PlainTextPart(String text) {
- this.text = text;
+ public PlainTextPart(@Nonnull String text) {
+ this.text = Objects.requireNonNull(text);
}
}
- //
- // PART METHODS
- //
-
- /**
- * Returns the text of this part.
- *
- * @return The text of this part
- */
@Override
@Override
+ @Nonnull
public String getText() {
return text;
}
public String getText() {
return text;
}