/modules/apps/archived/oauth-api/src/main/java/com/liferay/oauth/model/OAuthApplicationWrapper.java

https://github.com/danielreuther/liferay-portal · Java · 528 lines · 253 code · 78 blank · 197 comment · 30 complexity · 41a4c3ed746a37fa842bd1d37fddfc85 MD5 · raw file

  1. /**
  2. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. package com.liferay.oauth.model;
  15. import com.liferay.portal.kernel.model.ModelWrapper;
  16. import com.liferay.portal.kernel.model.wrapper.BaseModelWrapper;
  17. import java.util.Date;
  18. import java.util.HashMap;
  19. import java.util.Map;
  20. /**
  21. * <p>
  22. * This class is a wrapper for {@link OAuthApplication}.
  23. * </p>
  24. *
  25. * @author Ivica Cardic
  26. * @see OAuthApplication
  27. * @generated
  28. */
  29. public class OAuthApplicationWrapper
  30. extends BaseModelWrapper<OAuthApplication>
  31. implements ModelWrapper<OAuthApplication>, OAuthApplication {
  32. public OAuthApplicationWrapper(OAuthApplication oAuthApplication) {
  33. super(oAuthApplication);
  34. }
  35. @Override
  36. public Map<String, Object> getModelAttributes() {
  37. Map<String, Object> attributes = new HashMap<String, Object>();
  38. attributes.put("oAuthApplicationId", getOAuthApplicationId());
  39. attributes.put("companyId", getCompanyId());
  40. attributes.put("userId", getUserId());
  41. attributes.put("userName", getUserName());
  42. attributes.put("createDate", getCreateDate());
  43. attributes.put("modifiedDate", getModifiedDate());
  44. attributes.put("name", getName());
  45. attributes.put("description", getDescription());
  46. attributes.put("consumerKey", getConsumerKey());
  47. attributes.put("consumerSecret", getConsumerSecret());
  48. attributes.put("accessLevel", getAccessLevel());
  49. attributes.put("logoId", getLogoId());
  50. attributes.put("shareableAccessToken", isShareableAccessToken());
  51. attributes.put("callbackURI", getCallbackURI());
  52. attributes.put("websiteURL", getWebsiteURL());
  53. return attributes;
  54. }
  55. @Override
  56. public void setModelAttributes(Map<String, Object> attributes) {
  57. Long oAuthApplicationId = (Long)attributes.get("oAuthApplicationId");
  58. if (oAuthApplicationId != null) {
  59. setOAuthApplicationId(oAuthApplicationId);
  60. }
  61. Long companyId = (Long)attributes.get("companyId");
  62. if (companyId != null) {
  63. setCompanyId(companyId);
  64. }
  65. Long userId = (Long)attributes.get("userId");
  66. if (userId != null) {
  67. setUserId(userId);
  68. }
  69. String userName = (String)attributes.get("userName");
  70. if (userName != null) {
  71. setUserName(userName);
  72. }
  73. Date createDate = (Date)attributes.get("createDate");
  74. if (createDate != null) {
  75. setCreateDate(createDate);
  76. }
  77. Date modifiedDate = (Date)attributes.get("modifiedDate");
  78. if (modifiedDate != null) {
  79. setModifiedDate(modifiedDate);
  80. }
  81. String name = (String)attributes.get("name");
  82. if (name != null) {
  83. setName(name);
  84. }
  85. String description = (String)attributes.get("description");
  86. if (description != null) {
  87. setDescription(description);
  88. }
  89. String consumerKey = (String)attributes.get("consumerKey");
  90. if (consumerKey != null) {
  91. setConsumerKey(consumerKey);
  92. }
  93. String consumerSecret = (String)attributes.get("consumerSecret");
  94. if (consumerSecret != null) {
  95. setConsumerSecret(consumerSecret);
  96. }
  97. Integer accessLevel = (Integer)attributes.get("accessLevel");
  98. if (accessLevel != null) {
  99. setAccessLevel(accessLevel);
  100. }
  101. Long logoId = (Long)attributes.get("logoId");
  102. if (logoId != null) {
  103. setLogoId(logoId);
  104. }
  105. Boolean shareableAccessToken = (Boolean)attributes.get(
  106. "shareableAccessToken");
  107. if (shareableAccessToken != null) {
  108. setShareableAccessToken(shareableAccessToken);
  109. }
  110. String callbackURI = (String)attributes.get("callbackURI");
  111. if (callbackURI != null) {
  112. setCallbackURI(callbackURI);
  113. }
  114. String websiteURL = (String)attributes.get("websiteURL");
  115. if (websiteURL != null) {
  116. setWebsiteURL(websiteURL);
  117. }
  118. }
  119. @Override
  120. public OAuthApplication cloneWithOriginalValues() {
  121. return wrap(model.cloneWithOriginalValues());
  122. }
  123. /**
  124. * Returns the access level of this o auth application.
  125. *
  126. * @return the access level of this o auth application
  127. */
  128. @Override
  129. public int getAccessLevel() {
  130. return model.getAccessLevel();
  131. }
  132. @Override
  133. public String getAccessLevelLabel() {
  134. return model.getAccessLevelLabel();
  135. }
  136. /**
  137. * Returns the callback uri of this o auth application.
  138. *
  139. * @return the callback uri of this o auth application
  140. */
  141. @Override
  142. public String getCallbackURI() {
  143. return model.getCallbackURI();
  144. }
  145. /**
  146. * Returns the company ID of this o auth application.
  147. *
  148. * @return the company ID of this o auth application
  149. */
  150. @Override
  151. public long getCompanyId() {
  152. return model.getCompanyId();
  153. }
  154. /**
  155. * Returns the consumer key of this o auth application.
  156. *
  157. * @return the consumer key of this o auth application
  158. */
  159. @Override
  160. public String getConsumerKey() {
  161. return model.getConsumerKey();
  162. }
  163. /**
  164. * Returns the consumer secret of this o auth application.
  165. *
  166. * @return the consumer secret of this o auth application
  167. */
  168. @Override
  169. public String getConsumerSecret() {
  170. return model.getConsumerSecret();
  171. }
  172. /**
  173. * Returns the create date of this o auth application.
  174. *
  175. * @return the create date of this o auth application
  176. */
  177. @Override
  178. public Date getCreateDate() {
  179. return model.getCreateDate();
  180. }
  181. /**
  182. * Returns the description of this o auth application.
  183. *
  184. * @return the description of this o auth application
  185. */
  186. @Override
  187. public String getDescription() {
  188. return model.getDescription();
  189. }
  190. /**
  191. * Returns the logo ID of this o auth application.
  192. *
  193. * @return the logo ID of this o auth application
  194. */
  195. @Override
  196. public long getLogoId() {
  197. return model.getLogoId();
  198. }
  199. /**
  200. * Returns the modified date of this o auth application.
  201. *
  202. * @return the modified date of this o auth application
  203. */
  204. @Override
  205. public Date getModifiedDate() {
  206. return model.getModifiedDate();
  207. }
  208. /**
  209. * Returns the name of this o auth application.
  210. *
  211. * @return the name of this o auth application
  212. */
  213. @Override
  214. public String getName() {
  215. return model.getName();
  216. }
  217. /**
  218. * Returns the o auth application ID of this o auth application.
  219. *
  220. * @return the o auth application ID of this o auth application
  221. */
  222. @Override
  223. public long getOAuthApplicationId() {
  224. return model.getOAuthApplicationId();
  225. }
  226. /**
  227. * Returns the primary key of this o auth application.
  228. *
  229. * @return the primary key of this o auth application
  230. */
  231. @Override
  232. public long getPrimaryKey() {
  233. return model.getPrimaryKey();
  234. }
  235. /**
  236. * Returns the shareable access token of this o auth application.
  237. *
  238. * @return the shareable access token of this o auth application
  239. */
  240. @Override
  241. public boolean getShareableAccessToken() {
  242. return model.getShareableAccessToken();
  243. }
  244. /**
  245. * Returns the user ID of this o auth application.
  246. *
  247. * @return the user ID of this o auth application
  248. */
  249. @Override
  250. public long getUserId() {
  251. return model.getUserId();
  252. }
  253. /**
  254. * Returns the user name of this o auth application.
  255. *
  256. * @return the user name of this o auth application
  257. */
  258. @Override
  259. public String getUserName() {
  260. return model.getUserName();
  261. }
  262. /**
  263. * Returns the user uuid of this o auth application.
  264. *
  265. * @return the user uuid of this o auth application
  266. */
  267. @Override
  268. public String getUserUuid() {
  269. return model.getUserUuid();
  270. }
  271. /**
  272. * Returns the website url of this o auth application.
  273. *
  274. * @return the website url of this o auth application
  275. */
  276. @Override
  277. public String getWebsiteURL() {
  278. return model.getWebsiteURL();
  279. }
  280. /**
  281. * Returns <code>true</code> if this o auth application is shareable access token.
  282. *
  283. * @return <code>true</code> if this o auth application is shareable access token; <code>false</code> otherwise
  284. */
  285. @Override
  286. public boolean isShareableAccessToken() {
  287. return model.isShareableAccessToken();
  288. }
  289. @Override
  290. public void persist() {
  291. model.persist();
  292. }
  293. /**
  294. * Sets the access level of this o auth application.
  295. *
  296. * @param accessLevel the access level of this o auth application
  297. */
  298. @Override
  299. public void setAccessLevel(int accessLevel) {
  300. model.setAccessLevel(accessLevel);
  301. }
  302. /**
  303. * Sets the callback uri of this o auth application.
  304. *
  305. * @param callbackURI the callback uri of this o auth application
  306. */
  307. @Override
  308. public void setCallbackURI(String callbackURI) {
  309. model.setCallbackURI(callbackURI);
  310. }
  311. /**
  312. * Sets the company ID of this o auth application.
  313. *
  314. * @param companyId the company ID of this o auth application
  315. */
  316. @Override
  317. public void setCompanyId(long companyId) {
  318. model.setCompanyId(companyId);
  319. }
  320. /**
  321. * Sets the consumer key of this o auth application.
  322. *
  323. * @param consumerKey the consumer key of this o auth application
  324. */
  325. @Override
  326. public void setConsumerKey(String consumerKey) {
  327. model.setConsumerKey(consumerKey);
  328. }
  329. /**
  330. * Sets the consumer secret of this o auth application.
  331. *
  332. * @param consumerSecret the consumer secret of this o auth application
  333. */
  334. @Override
  335. public void setConsumerSecret(String consumerSecret) {
  336. model.setConsumerSecret(consumerSecret);
  337. }
  338. /**
  339. * Sets the create date of this o auth application.
  340. *
  341. * @param createDate the create date of this o auth application
  342. */
  343. @Override
  344. public void setCreateDate(Date createDate) {
  345. model.setCreateDate(createDate);
  346. }
  347. /**
  348. * Sets the description of this o auth application.
  349. *
  350. * @param description the description of this o auth application
  351. */
  352. @Override
  353. public void setDescription(String description) {
  354. model.setDescription(description);
  355. }
  356. /**
  357. * Sets the logo ID of this o auth application.
  358. *
  359. * @param logoId the logo ID of this o auth application
  360. */
  361. @Override
  362. public void setLogoId(long logoId) {
  363. model.setLogoId(logoId);
  364. }
  365. /**
  366. * Sets the modified date of this o auth application.
  367. *
  368. * @param modifiedDate the modified date of this o auth application
  369. */
  370. @Override
  371. public void setModifiedDate(Date modifiedDate) {
  372. model.setModifiedDate(modifiedDate);
  373. }
  374. /**
  375. * Sets the name of this o auth application.
  376. *
  377. * @param name the name of this o auth application
  378. */
  379. @Override
  380. public void setName(String name) {
  381. model.setName(name);
  382. }
  383. /**
  384. * Sets the o auth application ID of this o auth application.
  385. *
  386. * @param oAuthApplicationId the o auth application ID of this o auth application
  387. */
  388. @Override
  389. public void setOAuthApplicationId(long oAuthApplicationId) {
  390. model.setOAuthApplicationId(oAuthApplicationId);
  391. }
  392. /**
  393. * Sets the primary key of this o auth application.
  394. *
  395. * @param primaryKey the primary key of this o auth application
  396. */
  397. @Override
  398. public void setPrimaryKey(long primaryKey) {
  399. model.setPrimaryKey(primaryKey);
  400. }
  401. /**
  402. * Sets whether this o auth application is shareable access token.
  403. *
  404. * @param shareableAccessToken the shareable access token of this o auth application
  405. */
  406. @Override
  407. public void setShareableAccessToken(boolean shareableAccessToken) {
  408. model.setShareableAccessToken(shareableAccessToken);
  409. }
  410. /**
  411. * Sets the user ID of this o auth application.
  412. *
  413. * @param userId the user ID of this o auth application
  414. */
  415. @Override
  416. public void setUserId(long userId) {
  417. model.setUserId(userId);
  418. }
  419. /**
  420. * Sets the user name of this o auth application.
  421. *
  422. * @param userName the user name of this o auth application
  423. */
  424. @Override
  425. public void setUserName(String userName) {
  426. model.setUserName(userName);
  427. }
  428. /**
  429. * Sets the user uuid of this o auth application.
  430. *
  431. * @param userUuid the user uuid of this o auth application
  432. */
  433. @Override
  434. public void setUserUuid(String userUuid) {
  435. model.setUserUuid(userUuid);
  436. }
  437. /**
  438. * Sets the website url of this o auth application.
  439. *
  440. * @param websiteURL the website url of this o auth application
  441. */
  442. @Override
  443. public void setWebsiteURL(String websiteURL) {
  444. model.setWebsiteURL(websiteURL);
  445. }
  446. @Override
  447. protected OAuthApplicationWrapper wrap(OAuthApplication oAuthApplication) {
  448. return new OAuthApplicationWrapper(oAuthApplication);
  449. }
  450. }