X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FSonePart.java;h=576eb7b3afc41966d50f620f4868e517f604817c;hb=7d424e80eaf668651a2e2dfa242b75621f5def19;hp=37f098bb5efd1bb50307b576951eb15b3f54c2f1;hpb=61fea0173ef87542cae35247e6356ef36f2664d3;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/text/SonePart.java b/src/main/java/net/pterodactylus/sone/text/SonePart.java index 37f098b..576eb7b 100644 --- a/src/main/java/net/pterodactylus/sone/text/SonePart.java +++ b/src/main/java/net/pterodactylus/sone/text/SonePart.java @@ -1,5 +1,5 @@ /* - * Sone - SoneLinkPart.java - Copyright © 2011–2012 David Roden + * Sone - SonePart.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.Sone; import net.pterodactylus.sone.template.SoneAccessor; @@ -27,39 +31,17 @@ import net.pterodactylus.sone.template.SoneAccessor; */ public class SonePart implements Part { - /** The referenced {@link Sone}. */ private final Sone sone; - /** - * Creates a new Sone part. - * - * @param sone - * The referenced Sone - */ - public SonePart(Sone sone) { - this.sone = sone; + public SonePart(@Nonnull Sone sone) { + this.sone = Objects.requireNonNull(sone); } - // - // ACCESSORS - // - - /** - * Returns the referenced Sone. - * - * @return The referenced Sone - */ + @Nonnull public Sone getSone() { return sone; } - // - // PART METHODS - // - - /** - * {@inheritDoc} - */ @Override public String getText() { return SoneAccessor.getNiceName(sone);