Add filter for linked images
[Sone.git] / src / main / java / net / pterodactylus / sone / text / SonePart.java
index b460a29..576eb7b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - SoneLinkPart.java - Copyright © 2011 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
 
 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;
 
 /**
- * TODO
+ * {@link Part} implementation that stores a reference to a {@link Sone}.
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
@@ -29,12 +33,18 @@ public class SonePart implements Part {
 
        private final Sone sone;
 
-       public SonePart(Sone sone) {
-               this.sone = sone;
+       public SonePart(@Nonnull Sone sone) {
+               this.sone = Objects.requireNonNull(sone);
        }
 
+       @Nonnull
        public Sone getSone() {
                return sone;
        }
 
+       @Override
+       public String getText() {
+               return SoneAccessor.getNiceName(sone);
+       }
+
 }