Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. package com;
  2.  
  3. public class Consultation {
  4. private int id;
  5. private String name;
  6. private String dateStart;
  7. private String place;
  8. private String problem;
  9. private double price;
  10. private Lawyer lawyer;
  11. private Client client;
  12. private boolean active;
  13. private boolean complete;
  14. private int time;
  15. private final static double LAWYER_CONSULTATION_PERCENT = 0.56;
  16.  
  17. private void activateConsultation() {
  18. this.active = true;
  19. }
  20.  
  21. private void completeConsultation() {
  22. this.complete = true;
  23. }
  24.  
  25. private double getConsultationPrice() throws Exception {
  26. if (lawyer != null)
  27. return LAWYER_CONSULTATION_PERCENT * lawyer.getLawyerPayForOur() * time;
  28. throw new Exception("No Lawyer");
  29. }
  30.  
  31. private void addLawyerToConsultation(Lawyer lawyer) {
  32. this.lawyer = lawyer;
  33. }
  34.  
  35. public Consultation(String name, String dateStart, String place, String problem, double price, boolean active, boolean complete, int time) {
  36. this.name = name;
  37. this.dateStart = dateStart;
  38. this.place = place;
  39. this.problem = problem;
  40. this.price = price;
  41. this.active = active;
  42. this.complete = complete;
  43. this.time = time;
  44. }
  45.  
  46. public void save(){
  47. //todo
  48. //save
  49. }
  50.  
  51. public String getName() {
  52. return name;
  53. }
  54.  
  55. public void setName(String name) {
  56. this.name = name;
  57. }
  58.  
  59. public String getDateStart() {
  60. return dateStart;
  61. }
  62.  
  63. public void setDateStart(String dateStart) {
  64. this.dateStart = dateStart;
  65. }
  66.  
  67. public String getPlace() {
  68. return place;
  69. }
  70.  
  71. public void setPlace(String place) {
  72. this.place = place;
  73. }
  74.  
  75. public String getProblem() {
  76. return problem;
  77. }
  78.  
  79. public void setProblem(String problem) {
  80. this.problem = problem;
  81. }
  82.  
  83. public double getPrice() {
  84. return price;
  85. }
  86.  
  87. public void setPrice(double price) {
  88. this.price = price;
  89. }
  90.  
  91. public Lawyer getLawyer() {
  92. return lawyer;
  93. }
  94.  
  95. public void setLawyer(Lawyer lawyer) {
  96. this.lawyer = lawyer;
  97. }
  98.  
  99. public Client getClient() {
  100. return client;
  101. }
  102.  
  103. public void setClient(Client client) {
  104. this.client = client;
  105. }
  106.  
  107. public boolean isActive() {
  108. return active;
  109. }
  110.  
  111. public void setActive(boolean active) {
  112. this.active = active;
  113. }
  114.  
  115. public boolean isComplete() {
  116. return complete;
  117. }
  118.  
  119. public void setComplete(boolean complete) {
  120. this.complete = complete;
  121. }
  122.  
  123. public int getTime() {
  124. return time;
  125. }
  126.  
  127. public void setTime(int time) {
  128. this.time = time;
  129. }
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement