Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.32 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.polsl.engineerproject.api.model;
  7.  
  8. import com.polsl.engineerproject.model.Category;
  9. import com.polsl.engineerproject.model.HeadCategory;
  10. import com.polsl.engineerproject.model.Topic;
  11. import com.polsl.engineerproject.model.User;
  12. import java.util.Collection;
  13. import java.util.Date;
  14.  
  15. public class CategoryApi {
  16.  
  17.     private Integer id;
  18.     private String description;
  19.     private Date createdDate;
  20.     private Date modifiedDate;
  21.     private String name;
  22.     private UserApi authorId;
  23.     private HeadCategoryApi headCategoryId;
  24.  
  25.     public CategoryApi(Category category, User user, HeadCategory headCategory) {
  26.         this.id = category.getId();
  27.         this.authorId = new UserApi(user);
  28.         this.createdDate = category.getCreatedDate();
  29.         this.description = category.getDescription();
  30.         this.name = category.getName();
  31.         this.modifiedDate = category.getModifiedDate();
  32.         this.headCategoryId = new HeadCategoryApi(headCategory);
  33.     }
  34.  
  35.     public Integer getId() {
  36.         return id;
  37.     }
  38.  
  39.     public void setId(int id) {
  40.         this.id = id;
  41.     }
  42.  
  43.     public String getDescription() {
  44.         return description;
  45.     }
  46.  
  47.     public void setDescription(String description) {
  48.         this.description = description;
  49.     }
  50.  
  51.     public Date getCreatedDate() {
  52.         return createdDate;
  53.     }
  54.  
  55.     public void setCreatedDate(Date createdDate) {
  56.         this.createdDate = createdDate;
  57.     }
  58.  
  59.     public Date getModifiedDate() {
  60.         return modifiedDate;
  61.     }
  62.  
  63.     public void setModifiedDate(Date modifiedDate) {
  64.         this.modifiedDate = modifiedDate;
  65.     }
  66.  
  67.     public String getName() {
  68.         return name;
  69.     }
  70.  
  71.     public void setName(String name) {
  72.         this.name = name;
  73.     }
  74.  
  75.     public UserApi getAuthorId() {
  76.         return authorId;
  77.     }
  78.  
  79.     public void setAuthorId(UserApi authorId) {
  80.         this.authorId = authorId;
  81.     }
  82.  
  83.     public HeadCategoryApi getHeadCategoryId() {
  84.         return headCategoryId;
  85.     }
  86.  
  87.     public void setHeadCategoryId(HeadCategoryApi headCategoryId) {
  88.         this.headCategoryId = headCategoryId;
  89.     }
  90.  
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement