BrightSide Workbench Full Report + Source Code
CommentAttribute.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Affero General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
14
*
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
package
org.turro.contacts.proposal;
19
20
import
java.util.ArrayList;
21
import
java.util.List;
22
import
org.turro.contacts.Comment;
23
import
org.turro.contacts.Contact;
24
import
org.turro.i18n.I_;
25
30
public
class
CommentAttribute
extends
GenericAttribute
<Comment> {
31
32
public
CommentAttribute
(
Comment
attribute
) {
33
super(
attribute
);
34
duplication
=
DuplicationType
.
ALLOW_DUPLICATES
;
35
}
36
37
@Override
38
protected
List<Comment>
generateRelated
() {
39
return
new
ArrayList<Comment>();
40
}
41
42
@Override
43
public
void
addToContact
(
Contact
contact) {
44
attribute
.setContact(contact);
45
contact.
getComments
().add(
attribute
);
46
}
47
48
@Override
49
public
String
getAsString
() {
50
return
attribute
.getComment();
51
}
52
53
@Override
54
public
Contact
getContact
() {
55
return
attribute
.getContact();
56
}
57
58
@Override
59
public
String
getAttributeName
() {
60
return
I_
.
get
(
"Comment"
);
61
}
62
63
@Override
64
public
IAttribute
generateAttributeAdapter
(
final
Comment
a) {
65
return
new
IAttribute
() {
66
67
@Override
68
public
String
getAsString
() {
69
return
a.
getComment
();
70
}
71
72
@Override
73
public
Contact
getContact
() {
74
return
a.
getContact
();
75
}
76
77
@Override
78
public
Object
getValue
() {
79
return
a;
80
}
81
};
82
83
}
84
85
}
org.turro.contacts.Comment
Definition:
Comment.java:27
org.turro.contacts.Comment.getContact
Contact getContact()
Definition:
Comment.java:89
org.turro.contacts.Comment.getComment
String getComment()
Definition:
Comment.java:81
org.turro.contacts.Contact
Definition:
Contact.java:52
org.turro.contacts.Contact.getComments
Set< Comment > getComments()
Definition:
Contact.java:415
org.turro.contacts.proposal.CommentAttribute
Definition:
CommentAttribute.java:30
org.turro.contacts.proposal.CommentAttribute.generateRelated
List< Comment > generateRelated()
Definition:
CommentAttribute.java:38
org.turro.contacts.proposal.CommentAttribute.getAttributeName
String getAttributeName()
Definition:
CommentAttribute.java:59
org.turro.contacts.proposal.CommentAttribute.getAsString
String getAsString()
Definition:
CommentAttribute.java:49
org.turro.contacts.proposal.CommentAttribute.CommentAttribute
CommentAttribute(Comment attribute)
Definition:
CommentAttribute.java:32
org.turro.contacts.proposal.CommentAttribute.generateAttributeAdapter
IAttribute generateAttributeAdapter(final Comment a)
Definition:
CommentAttribute.java:64
org.turro.contacts.proposal.CommentAttribute.addToContact
void addToContact(Contact contact)
Definition:
CommentAttribute.java:43
org.turro.contacts.proposal.CommentAttribute.getContact
Contact getContact()
Definition:
CommentAttribute.java:54
org.turro.contacts.proposal.GenericAttribute
Definition:
GenericAttribute.java:29
org.turro.contacts.proposal.GenericAttribute< Comment >::attribute
A attribute
Definition:
GenericAttribute.java:31
org.turro.contacts.proposal.GenericAttribute< Comment >::duplication
DuplicationType duplication
Definition:
GenericAttribute.java:33
org.turro.contacts.proposal.GenericAttribute< Comment >::getValue
A getValue()
Definition:
GenericAttribute.java:48
org.turro.i18n.I_
Definition:
I_.java:39
org.turro.i18n.I_.get
static String get(String msg)
Definition:
I_.java:41
org.turro.contacts.proposal.DuplicationType
Definition:
DuplicationType.java:24
org.turro.contacts.proposal.DuplicationType.ALLOW_DUPLICATES
ALLOW_DUPLICATES
Definition:
DuplicationType.java:28
org.turro.contacts.proposal.IAttribute
Definition:
IAttribute.java:26
TurroProjects
Public
BrightSide
contacts
src
main
java
org
turro
contacts
proposal
CommentAttribute.java
Generated on Tue Mar 12 2024 07:01:18 for BrightSide by
1.9.1