Update year in copyright lines
[Sone.git] / src / main / java / net / pterodactylus / sone / text / PostPart.java
index 1e0773d..de957c5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - PostLinkPart.java - Copyright © 2011 David Roden
+ * Sone - PostPart.java - Copyright © 2011–2019 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;
+
 import net.pterodactylus.sone.data.Post;
 
 /**
- * TODO
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ * {@link Part} implementation that stores a reference to a {@link Post}.
  */
 public class PostPart implements Part {
 
        private final Post post;
 
-       public PostPart(Post post) {
-               this.post = post;
+       public PostPart(@Nonnull Post post) {
+               this.post = Objects.requireNonNull(post);
        }
 
+       @Nonnull
        public Post getPost() {
                return post;
        }
 
+       @Override
+       public String getText() {
+               return post.getText();
+       }
+
 }