Template.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /**
  2. * Copyright (c) 2015-2016, Michael Yang 杨福海 (fuhai999@gmail.com).
  3. *
  4. * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.gnu.org/licenses/lgpl-3.0.txt
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package io.jpress.template;
  17. import java.util.List;
  18. public class Template {
  19. private String id;
  20. private String title;
  21. private String description;
  22. private String author;
  23. private String authorWebsite;
  24. private String version;
  25. private int versionCode;
  26. private String updateUrl;
  27. private String path;
  28. private String renderType;
  29. private String screenshot;
  30. private List<TplModule> modulesAll;
  31. private List<TplModule> modules;
  32. private List<Thumbnail> thumbnails;
  33. public String getId() {
  34. return id;
  35. }
  36. public void setId(String id) {
  37. this.id = id;
  38. }
  39. public String getTitle() {
  40. return title;
  41. }
  42. public void setTitle(String title) {
  43. this.title = title;
  44. }
  45. public String getDescription() {
  46. return description;
  47. }
  48. public void setDescription(String description) {
  49. this.description = description;
  50. }
  51. public String getAuthor() {
  52. return author;
  53. }
  54. public void setAuthor(String author) {
  55. this.author = author;
  56. }
  57. public String getAuthorWebsite() {
  58. return authorWebsite;
  59. }
  60. public void setAuthorWebsite(String authorWebsite) {
  61. this.authorWebsite = authorWebsite;
  62. }
  63. public String getVersion() {
  64. return version;
  65. }
  66. public void setVersion(String version) {
  67. this.version = version;
  68. }
  69. public int getVersionCode() {
  70. return versionCode;
  71. }
  72. public void setVersionCode(int versionCode) {
  73. this.versionCode = versionCode;
  74. }
  75. public List<TplModule> getModules() {
  76. return modules;
  77. }
  78. public void setModules(List<TplModule> modules) {
  79. this.modules = modules;
  80. }
  81. public List<TplModule> getModulesAll() {
  82. return modulesAll;
  83. }
  84. public void setModulesAll(List<TplModule> modulesAll) {
  85. this.modulesAll = modulesAll;
  86. }
  87. public List<Thumbnail> getThumbnails() {
  88. return thumbnails;
  89. }
  90. public void setThumbnails(List<Thumbnail> thumbnails) {
  91. this.thumbnails = thumbnails;
  92. }
  93. public String getUpdateUrl() {
  94. return updateUrl;
  95. }
  96. public void setUpdateUrl(String updateUrl) {
  97. this.updateUrl = updateUrl;
  98. }
  99. public String getPath() {
  100. return path;
  101. }
  102. public void setPath(String path) {
  103. this.path = path;
  104. }
  105. public String getRenderType() {
  106. return renderType;
  107. }
  108. public void setRenderType(String renderType) {
  109. this.renderType = renderType;
  110. }
  111. public String getScreenshot() {
  112. return screenshot;
  113. }
  114. public void setScreenshot(String screenshot) {
  115. this.screenshot = screenshot;
  116. }
  117. public TplModule getModuleByName(String name) {
  118. if (modulesAll != null && name != null) {
  119. for (TplModule m : modulesAll) {
  120. if (name.equals(m.getName())) {
  121. return m;
  122. }
  123. }
  124. }
  125. return null;
  126. }
  127. public Thumbnail getThumbnailByName(String name) {
  128. if (thumbnails != null && name != null) {
  129. for (Thumbnail t : thumbnails) {
  130. if (name.equals(t.getName())) {
  131. return t;
  132. }
  133. }
  134. }
  135. return null;
  136. }
  137. }