projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Override equals() and hashCode() to make clear that they don’t need to be.
[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
..
f531bab
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
–2013
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
@@
-18,20
+18,45
@@
package net.pterodactylus.sone.text;
/**
package net.pterodactylus.sone.text;
/**
- * 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>
*/
public class LinkPart implements Part {
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class LinkPart implements Part {
+ /** The link of this part. */
private final String link;
private final String link;
+
+ /** The text of this part. */
private final String text;
private final String text;
+
+ /** The title of this part. */
private final String title;
private final String title;
+ /**
+ * Creates a new link part.
+ *
+ * @param link
+ * The link of the link part
+ * @param text
+ * The text of the link part
+ */
public LinkPart(String link, String text) {
this(link, text, text);
}
public LinkPart(String link, String text) {
this(link, text, text);
}
+ /**
+ * Creates a new link part.
+ *
+ * @param link
+ * The link of the link part
+ * @param text
+ * The text of the link part
+ * @param title
+ * The title of the link part
+ */
public LinkPart(String link, String text, String title) {
this.link = link;
this.text = text;
public LinkPart(String link, String text, String title) {
this.link = link;
this.text = text;
@@
-42,16
+67,36
@@
public class LinkPart implements Part {
// ACCESSORS
//
// ACCESSORS
//
+ /**
+ * Returns the link of this part.
+ *
+ * @return The link of this part
+ */
public String getLink() {
return link;
}
public String getLink() {
return link;
}
- public String getText() {
- return text;
- }
-
+ /**
+ * Returns the title of this part.
+ *
+ * @return The title of this part
+ */
public String getTitle() {
return title;
}
public String getTitle() {
return title;
}
+ //
+ // PART METHODS
+ //
+
+ /**
+ * Returns the text of this part.
+ *
+ * @return The text of this part
+ */
+ @Override
+ public String getText() {
+ return text;
+ }
+
}
}