projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'release-0.9.6'
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
text
/
LinkPart.java
diff --git
a/src/main/java/net/pterodactylus/sone/text/LinkPart.java
b/src/main/java/net/pterodactylus/sone/text/LinkPart.java
index
d911bbd
..
9f889ef
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/text/LinkPart.java
+++ b/
src/main/java/net/pterodactylus/sone/text/LinkPart.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - LinkPart.java - Copyright © 2011 David Roden
+ * Sone - LinkPart.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
*
* 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,8
+17,14
@@
package net.pterodactylus.sone.text;
package net.pterodactylus.sone.text;
+import java.util.Objects;
+
+import javax.annotation.Nonnull;
+
/**
/**
- * TODO
+ * {@link Part} implementation that can hold a link. A link contains of three
+ * attributes: the link itself, the text that is shown instead of the link, and
+ * an explanatory text that can be displayed e.g. as a tooltip.
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
@@
-28,30
+34,30
@@
public class LinkPart implements Part {
private final String text;
private final String title;
private final String text;
private final String title;
- public LinkPart(
String link,
String text) {
+ public LinkPart(
@Nonnull String link, @Nonnull
String text) {
this(link, text, text);
}
this(link, text, text);
}
- public LinkPart(
String link, String text,
String title) {
- this.link =
link
;
- this.text =
text
;
- this.title =
title
;
+ public LinkPart(
@Nonnull String link, @Nonnull String text, @Nonnull
String title) {
+ this.link =
Objects.requireNonNull(link)
;
+ this.text =
Objects.requireNonNull(text)
;
+ this.title =
Objects.requireNonNull(title)
;
}
}
- //
- // ACCESSORS
- //
-
+ @Nonnull
public String getLink() {
return link;
}
public String getLink() {
return link;
}
- public String getText() {
- return text;
- }
-
+ @Nonnull
public String getTitle() {
return title;
}
public String getTitle() {
return title;
}
+ @Override
+ @Nonnull
+ public String getText() {
+ return text;
+ }
+
}
}