Merge branch 'release-0.9.6'
[Sone.git] / src / main / java / net / pterodactylus / sone / text / PlainTextPart.java
index 9090eb3..7bdbee9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - PlainTextPart.java - Copyright © 2011–2015 David Roden
+ * Sone - PlainTextPart.java - Copyright © 2011–2016 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 package net.pterodactylus.sone.text;
 
+import java.util.Objects;
+
+import javax.annotation.Nonnull;
+
 /**
  * {@link Part} implementation that holds a single piece of text.
  *
@@ -24,29 +28,14 @@ package net.pterodactylus.sone.text;
  */
 public class PlainTextPart implements Part {
 
-       /** The text of the part. */
        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
+       @Nonnull
        public String getText() {
                return text;
        }