1 package net.swindle.springdemo.domain;
2
3 import net.swindle.springdemo.service.BusinessService;
4
5 import org.springframework.beans.factory.annotation.Autowired;
6
7
8
9
10
11
12 public class Organization {
13
14 private final String companyName;
15 private String slogan;
16 private BusinessService businessService;
17
18
19
20
21
22
23 public Organization(String companyName) {
24 this.companyName = companyName;
25 }
26
27
28
29
30
31
32 public String getCompanyName() {
33 return companyName;
34 }
35
36
37
38
39
40
41 @Autowired(required = false)
42 public void setPostalCode(String postalCode) {}
43
44
45
46
47
48
49 @Autowired(required = false)
50 public void setEmployeeCount(int employeeCount) {}
51
52
53
54
55
56
57 public void setSlogan(String slogan) {
58 this.slogan = slogan;
59 }
60
61
62
63
64
65
66 public void setBusinessService(BusinessService businessService) {
67 this.businessService = businessService;
68 }
69
70
71
72
73
74
75 public String corporateSlogan() {
76 return slogan;
77 }
78
79
80
81
82
83
84 public String corporateService() {
85 return businessService.offerService(companyName);
86 }
87 }