BrightSide Workbench Full Report + Source Code
org.turro.contacts.proposal.AddressAttribute Class Reference
Inheritance diagram for org.turro.contacts.proposal.AddressAttribute:
Collaboration diagram for org.turro.contacts.proposal.AddressAttribute:

Public Member Functions

 AddressAttribute (Address attribute)
 
void addToContact (Contact contact)
 
String getAsString ()
 
Contact getContact ()
 
String getAttributeName ()
 
IAttribute generateAttributeAdapter (final Address a)
 
- Public Member Functions inherited from org.turro.contacts.proposal.GenericAttribute< Address >
 GenericAttribute (A attribute)
 
boolean isActive ()
 
void setActive (boolean active)
 
getValue ()
 
List< IAttributegetRelated ()
 
void checkActive (Contact destination)
 
abstract void addToContact (Contact contact)
 
abstract String getAsString ()
 
abstract Contact getContact ()
 
abstract String getAttributeName ()
 
abstract IAttribute generateAttributeAdapter (A a)
 

Protected Member Functions

List< AddressgenerateRelated ()
 
- Protected Member Functions inherited from org.turro.contacts.proposal.GenericAttribute< Address >
abstract List< A > generateRelated ()
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.contacts.proposal.GenericAttribute< Address >
attribute
 
transient List< IAttributerelated
 
DuplicationType duplication
 
boolean active
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 33 of file AddressAttribute.java.

Constructor & Destructor Documentation

◆ AddressAttribute()

org.turro.contacts.proposal.AddressAttribute.AddressAttribute ( Address  attribute)

Definition at line 35 of file AddressAttribute.java.

35  {
36  super(attribute);
37  duplication = IUser.ADDRESS_FISCAL.equals(attribute.getDescription()) ?
38  DuplicationType.NOT_ALLOWED :
39  DuplicationType.WARN_DUPLICATION;
40  }

Member Function Documentation

◆ addToContact()

void org.turro.contacts.proposal.AddressAttribute.addToContact ( Contact  contact)

Definition at line 55 of file AddressAttribute.java.

55  {
56  attribute.setContact(contact);
57  contact.getAddresses().add(attribute);
58  }
Here is the call graph for this function:

◆ generateAttributeAdapter()

IAttribute org.turro.contacts.proposal.AddressAttribute.generateAttributeAdapter ( final Address  a)

Definition at line 76 of file AddressAttribute.java.

76  {
77  return new IAttribute() {
78 
79  @Override
80  public String getAsString() {
81  return a.getFullAddress();
82  }
83 
84  @Override
85  public Contact getContact() {
86  return a.getContact();
87  }
88 
89  @Override
90  public Object getValue() {
91  return a;
92  }
93  };
94  }
Here is the call graph for this function:

◆ generateRelated()

List<Address> org.turro.contacts.proposal.AddressAttribute.generateRelated ( )
protected

Definition at line 43 of file AddressAttribute.java.

43  {
44  Dao dao = new ContactsPU();
45  WhereClause wc = new WhereClause();
46  wc.addClause("select address from Address as address");
47  wc.addClause("where address.street = :street");
48  wc.addClause("and address.city = :city");
49  wc.addNamedValue("street", attribute.getStreet());
50  wc.addNamedValue("city", attribute.getCity());
51  return dao.getResultList(wc);
52  }
Here is the call graph for this function:

◆ getAsString()

String org.turro.contacts.proposal.AddressAttribute.getAsString ( )

Definition at line 61 of file AddressAttribute.java.

61  {
62  return attribute.getFullAddress();
63  }
Here is the caller graph for this function:

◆ getAttributeName()

String org.turro.contacts.proposal.AddressAttribute.getAttributeName ( )

Definition at line 71 of file AddressAttribute.java.

71  {
72  return I_.get("Address");
73  }
Here is the call graph for this function:

◆ getContact()

Contact org.turro.contacts.proposal.AddressAttribute.getContact ( )

Definition at line 66 of file AddressAttribute.java.

66  {
67  return attribute.getContact();
68  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: