Grundaufbau der App
[DHBWCampusApp.git] / app / src / main / java / de / dhbwloe / campusapp / search / SearchIndices.java
1 package de.dhbwloe.campusapp.search;
2
3 import java.util.Date;
4
5 /**
6  * Created by pk910 on 19.01.2016.
7  */
8 public class SearchIndices {
9     private String keyname = null;
10     private StringBuffer keywordsBuffer = new StringBuffer();
11     protected boolean isStatic = false;
12     protected String target = new String();
13     protected String keywords = null;
14     protected String title = null;
15     protected String description = null;
16     protected long updateTime = 0;
17
18     public SearchIndices(String keyname) {
19         this.keyname = keyname;
20         this.updateTime = (new Date()).getTime()/1000;
21     }
22
23     public SearchIndices(String keyname, boolean isStatic) {
24         this.keyname = keyname;
25         this.isStatic = isStatic;
26     }
27
28     public void addKeyWord(String words) {
29         if(keywordsBuffer.length() > 0)
30             keywordsBuffer.append('\n');
31         keywordsBuffer.append(words);
32     }
33
34     public void setTarget(String target) {
35         this.target = target;
36     }
37
38     public void setDescription(String description) {
39         this.description = description;
40     }
41
42     public void setTitle(String title) {
43         this.title = title;
44     }
45
46     public void setUpdateTime(long updateTime) {
47         this.updateTime = updateTime;
48     }
49
50     public String getKeyName() {
51         return this.keyname;
52     }
53
54     public String getKeyWords() {
55         return (this.keywords != null ? this.keywords : "") + this.keywordsBuffer.toString();
56     }
57
58     public boolean getIsStatic() {
59         return this.isStatic;
60     }
61
62     public String getTarget() {
63         return this.target;
64     }
65
66     public String getDescription() {
67         return this.description;
68     }
69
70     public String getTitle() {
71         return this.title;
72     }
73
74     public long getUpdateTime() {
75         return this.updateTime;
76     }
77 }
78