X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FPlainTextPart.java;h=7bdbee95ca0749b69f7e370bdfac91326b561e3b;hp=09c1fba3a35e5f74368fb6a4877282b16957b4c9;hb=7b55e0be6a3283e43a9bbab98f82aebdd948eb33;hpb=50ce65f69e49ed10abeedaeb6615ffb37a0c0772 diff --git a/src/main/java/net/pterodactylus/sone/text/PlainTextPart.java b/src/main/java/net/pterodactylus/sone/text/PlainTextPart.java index 09c1fba..7bdbee9 100644 --- a/src/main/java/net/pterodactylus/sone/text/PlainTextPart.java +++ b/src/main/java/net/pterodactylus/sone/text/PlainTextPart.java @@ -1,5 +1,5 @@ /* - * Sone - PlainTextPart.java - Copyright © 2011–2012 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 @@ -17,6 +17,10 @@ package net.pterodactylus.sone.text; +import java.util.Objects; + +import javax.annotation.Nonnull; + /** * {@link Part} implementation that holds a single piece of text. * @@ -24,28 +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); } - // - // ACCESSORS - // - - /** - * Returns the text of this part. - * - * @return The text of this part - */ + @Override + @Nonnull public String getText() { return text; }