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=f7177c9eb5685c4ab74a650d5ed2d4efaefb8b86;hb=7b55e0be6a3283e43a9bbab98f82aebdd948eb33;hpb=6f019de1d4d9742981d851ac3c9097cca8bff58e diff --git a/src/main/java/net/pterodactylus/sone/text/PostPart.java b/src/main/java/net/pterodactylus/sone/text/PostPart.java index f7177c9..e70448f 100644 --- a/src/main/java/net/pterodactylus/sone/text/PostPart.java +++ b/src/main/java/net/pterodactylus/sone/text/PostPart.java @@ -1,5 +1,5 @@ /* - * Sone - PostPart.java - Copyright © 2011–2013 David Roden + * Sone - PostPart.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 @@ -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();