/modules/apps/headless/headless-portal-instances/headless-portal-instances-client/src/main/java/com/liferay/headless/portal/instances/client/dto/v1_0/PortalInstance.java

https://github.com/danielreuther/liferay-portal · Java · 213 lines · 146 code · 50 blank · 17 comment · 3 complexity · 1d9dcf4dcf413ce3bfbd8880173f9ea0 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.headless.portal.instances.client.dto.v1_0;
  15. import com.liferay.headless.portal.instances.client.function.UnsafeSupplier;
  16. import com.liferay.headless.portal.instances.client.serdes.v1_0.PortalInstanceSerDes;
  17. import java.io.Serializable;
  18. import java.util.Objects;
  19. import javax.annotation.Generated;
  20. /**
  21. * @author Alberto Chaparro
  22. * @generated
  23. */
  24. @Generated("")
  25. public class PortalInstance implements Cloneable, Serializable {
  26. public static PortalInstance toDTO(String json) {
  27. return PortalInstanceSerDes.toDTO(json);
  28. }
  29. public Boolean getActive() {
  30. return active;
  31. }
  32. public void setActive(Boolean active) {
  33. this.active = active;
  34. }
  35. public void setActive(
  36. UnsafeSupplier<Boolean, Exception> activeUnsafeSupplier) {
  37. try {
  38. active = activeUnsafeSupplier.get();
  39. }
  40. catch (Exception e) {
  41. throw new RuntimeException(e);
  42. }
  43. }
  44. protected Boolean active;
  45. public Admin getAdmin() {
  46. return admin;
  47. }
  48. public void setAdmin(Admin admin) {
  49. this.admin = admin;
  50. }
  51. public void setAdmin(UnsafeSupplier<Admin, Exception> adminUnsafeSupplier) {
  52. try {
  53. admin = adminUnsafeSupplier.get();
  54. }
  55. catch (Exception e) {
  56. throw new RuntimeException(e);
  57. }
  58. }
  59. protected Admin admin;
  60. public Long getCompanyId() {
  61. return companyId;
  62. }
  63. public void setCompanyId(Long companyId) {
  64. this.companyId = companyId;
  65. }
  66. public void setCompanyId(
  67. UnsafeSupplier<Long, Exception> companyIdUnsafeSupplier) {
  68. try {
  69. companyId = companyIdUnsafeSupplier.get();
  70. }
  71. catch (Exception e) {
  72. throw new RuntimeException(e);
  73. }
  74. }
  75. protected Long companyId;
  76. public String getDomain() {
  77. return domain;
  78. }
  79. public void setDomain(String domain) {
  80. this.domain = domain;
  81. }
  82. public void setDomain(
  83. UnsafeSupplier<String, Exception> domainUnsafeSupplier) {
  84. try {
  85. domain = domainUnsafeSupplier.get();
  86. }
  87. catch (Exception e) {
  88. throw new RuntimeException(e);
  89. }
  90. }
  91. protected String domain;
  92. public String getPortalInstanceId() {
  93. return portalInstanceId;
  94. }
  95. public void setPortalInstanceId(String portalInstanceId) {
  96. this.portalInstanceId = portalInstanceId;
  97. }
  98. public void setPortalInstanceId(
  99. UnsafeSupplier<String, Exception> portalInstanceIdUnsafeSupplier) {
  100. try {
  101. portalInstanceId = portalInstanceIdUnsafeSupplier.get();
  102. }
  103. catch (Exception e) {
  104. throw new RuntimeException(e);
  105. }
  106. }
  107. protected String portalInstanceId;
  108. public String getSiteInitializerKey() {
  109. return siteInitializerKey;
  110. }
  111. public void setSiteInitializerKey(String siteInitializerKey) {
  112. this.siteInitializerKey = siteInitializerKey;
  113. }
  114. public void setSiteInitializerKey(
  115. UnsafeSupplier<String, Exception> siteInitializerKeyUnsafeSupplier) {
  116. try {
  117. siteInitializerKey = siteInitializerKeyUnsafeSupplier.get();
  118. }
  119. catch (Exception e) {
  120. throw new RuntimeException(e);
  121. }
  122. }
  123. protected String siteInitializerKey;
  124. public String getVirtualHost() {
  125. return virtualHost;
  126. }
  127. public void setVirtualHost(String virtualHost) {
  128. this.virtualHost = virtualHost;
  129. }
  130. public void setVirtualHost(
  131. UnsafeSupplier<String, Exception> virtualHostUnsafeSupplier) {
  132. try {
  133. virtualHost = virtualHostUnsafeSupplier.get();
  134. }
  135. catch (Exception e) {
  136. throw new RuntimeException(e);
  137. }
  138. }
  139. protected String virtualHost;
  140. @Override
  141. public PortalInstance clone() throws CloneNotSupportedException {
  142. return (PortalInstance)super.clone();
  143. }
  144. @Override
  145. public boolean equals(Object object) {
  146. if (this == object) {
  147. return true;
  148. }
  149. if (!(object instanceof PortalInstance)) {
  150. return false;
  151. }
  152. PortalInstance portalInstance = (PortalInstance)object;
  153. return Objects.equals(toString(), portalInstance.toString());
  154. }
  155. @Override
  156. public int hashCode() {
  157. String string = toString();
  158. return string.hashCode();
  159. }
  160. public String toString() {
  161. return PortalInstanceSerDes.toJSON(this);
  162. }
  163. }