X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FPostPart.java;h=e70448f3f61b8d6bd7cd8714a298a6223ebb0465;hb=7d424e80eaf668651a2e2dfa242b75621f5def19;hp=1e0773d65b21f295a03b17df82762415c889db95;hpb=ab7fada54ed08b0a8d9ce9c606cbea29c3c3f819;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/text/PostPart.java b/src/main/java/net/pterodactylus/sone/text/PostPart.java index 1e0773d..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 - PostLinkPart.java - Copyright © 2011 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,10 +17,14 @@ package net.pterodactylus.sone.text; +import java.util.Objects; + +import javax.annotation.Nonnull; + import net.pterodactylus.sone.data.Post; /** - * TODO + * {@link Part} implementation that stores a reference to a {@link Post}. * * @author David ‘Bombe’ Roden */ @@ -28,12 +32,18 @@ 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(); + } + }