X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FPostPart.java;h=e70448f3f61b8d6bd7cd8714a298a6223ebb0465;hp=68075a5949f06b8637ce0a12383ca687c4839e8c;hb=15f4c53dd87e07b452a04ec2d0e022197e09bd92;hpb=133960ca34d2ec746802bb8bd83235e50d308310 diff --git a/src/main/java/net/pterodactylus/sone/text/PostPart.java b/src/main/java/net/pterodactylus/sone/text/PostPart.java index 68075a5..e70448f 100644 --- a/src/main/java/net/pterodactylus/sone/text/PostPart.java +++ b/src/main/java/net/pterodactylus/sone/text/PostPart.java @@ -17,6 +17,10 @@ package net.pterodactylus.sone.text; +import java.util.Objects; + +import javax.annotation.Nonnull; + import net.pterodactylus.sone.data.Post; /** @@ -26,39 +30,17 @@ import net.pterodactylus.sone.data.Post; */ public class PostPart implements Part { - /** The post this part refers to. */ private final Post post; - /** - * Creates a new post part. - * - * @param post - * The referenced post - */ - public PostPart(Post post) { - this.post = post; + public PostPart(@Nonnull Post post) { + this.post = Objects.requireNonNull(post); } - // - // ACCESSORS - // - - /** - * Returns the post referenced by this part. - * - * @return The post referenced by this part - */ + @Nonnull public Post getPost() { return post; } - // - // PART METHODS - // - - /** - * {@inheritDoc} - */ @Override public String getText() { return post.getText();