Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.liferay.search.experiences.rest.dto.v1_0.SXPElement Maven / Gradle / Ivy
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
package com.liferay.search.experiences.rest.dto.v1_0;
import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.liferay.petra.function.UnsafeSupplier;
import com.liferay.petra.string.StringBundler;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.vulcan.graphql.annotation.GraphQLField;
import com.liferay.portal.vulcan.graphql.annotation.GraphQLName;
import com.liferay.portal.vulcan.util.ObjectMapperUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Supplier;
import javax.annotation.Generated;
import javax.validation.Valid;
import javax.xml.bind.annotation.XmlRootElement;
/**
* @author Brian Wing Shun Chan
* @generated
*/
@Generated("")
@GraphQLName("SXPElement")
@JsonFilter("Liferay.Vulcan")
@XmlRootElement(name = "SXPElement")
public class SXPElement implements Serializable {
public static SXPElement toDTO(String json) {
return ObjectMapperUtil.readValue(SXPElement.class, json);
}
public static SXPElement unsafeToDTO(String json) {
return ObjectMapperUtil.unsafeReadValue(SXPElement.class, json);
}
@Schema
@Valid
public Map> getActions() {
if (_actionsSupplier != null) {
actions = _actionsSupplier.get();
_actionsSupplier = null;
}
return actions;
}
public void setActions(Map> actions) {
this.actions = actions;
_actionsSupplier = null;
}
@JsonIgnore
public void setActions(
UnsafeSupplier>, Exception>
actionsUnsafeSupplier) {
_actionsSupplier = () -> {
try {
return actionsUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
protected Map> actions;
@JsonIgnore
private Supplier>> _actionsSupplier;
@Schema
public Date getCreateDate() {
if (_createDateSupplier != null) {
createDate = _createDateSupplier.get();
_createDateSupplier = null;
}
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
_createDateSupplier = null;
}
@JsonIgnore
public void setCreateDate(
UnsafeSupplier createDateUnsafeSupplier) {
_createDateSupplier = () -> {
try {
return createDateUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected Date createDate;
@JsonIgnore
private Supplier _createDateSupplier;
@Schema
public String getDescription() {
if (_descriptionSupplier != null) {
description = _descriptionSupplier.get();
_descriptionSupplier = null;
}
return description;
}
public void setDescription(String description) {
this.description = description;
_descriptionSupplier = null;
}
@JsonIgnore
public void setDescription(
UnsafeSupplier descriptionUnsafeSupplier) {
_descriptionSupplier = () -> {
try {
return descriptionUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String description;
@JsonIgnore
private Supplier _descriptionSupplier;
@Schema
@Valid
public Map getDescription_i18n() {
if (_description_i18nSupplier != null) {
description_i18n = _description_i18nSupplier.get();
_description_i18nSupplier = null;
}
return description_i18n;
}
public void setDescription_i18n(Map description_i18n) {
this.description_i18n = description_i18n;
_description_i18nSupplier = null;
}
@JsonIgnore
public void setDescription_i18n(
UnsafeSupplier, Exception>
description_i18nUnsafeSupplier) {
_description_i18nSupplier = () -> {
try {
return description_i18nUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected Map description_i18n;
@JsonIgnore
private Supplier> _description_i18nSupplier;
@Schema
@Valid
public ElementDefinition getElementDefinition() {
if (_elementDefinitionSupplier != null) {
elementDefinition = _elementDefinitionSupplier.get();
_elementDefinitionSupplier = null;
}
return elementDefinition;
}
public void setElementDefinition(ElementDefinition elementDefinition) {
this.elementDefinition = elementDefinition;
_elementDefinitionSupplier = null;
}
@JsonIgnore
public void setElementDefinition(
UnsafeSupplier
elementDefinitionUnsafeSupplier) {
_elementDefinitionSupplier = () -> {
try {
return elementDefinitionUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected ElementDefinition elementDefinition;
@JsonIgnore
private Supplier _elementDefinitionSupplier;
@Schema(example = "AB-34098-789-N")
public String getExternalReferenceCode() {
if (_externalReferenceCodeSupplier != null) {
externalReferenceCode = _externalReferenceCodeSupplier.get();
_externalReferenceCodeSupplier = null;
}
return externalReferenceCode;
}
public void setExternalReferenceCode(String externalReferenceCode) {
this.externalReferenceCode = externalReferenceCode;
_externalReferenceCodeSupplier = null;
}
@JsonIgnore
public void setExternalReferenceCode(
UnsafeSupplier externalReferenceCodeUnsafeSupplier) {
_externalReferenceCodeSupplier = () -> {
try {
return externalReferenceCodeUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String externalReferenceCode;
@JsonIgnore
private Supplier _externalReferenceCodeSupplier;
@Schema
public String getFallbackDescription() {
if (_fallbackDescriptionSupplier != null) {
fallbackDescription = _fallbackDescriptionSupplier.get();
_fallbackDescriptionSupplier = null;
}
return fallbackDescription;
}
public void setFallbackDescription(String fallbackDescription) {
this.fallbackDescription = fallbackDescription;
_fallbackDescriptionSupplier = null;
}
@JsonIgnore
public void setFallbackDescription(
UnsafeSupplier fallbackDescriptionUnsafeSupplier) {
_fallbackDescriptionSupplier = () -> {
try {
return fallbackDescriptionUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String fallbackDescription;
@JsonIgnore
private Supplier _fallbackDescriptionSupplier;
@Schema
public String getFallbackTitle() {
if (_fallbackTitleSupplier != null) {
fallbackTitle = _fallbackTitleSupplier.get();
_fallbackTitleSupplier = null;
}
return fallbackTitle;
}
public void setFallbackTitle(String fallbackTitle) {
this.fallbackTitle = fallbackTitle;
_fallbackTitleSupplier = null;
}
@JsonIgnore
public void setFallbackTitle(
UnsafeSupplier fallbackTitleUnsafeSupplier) {
_fallbackTitleSupplier = () -> {
try {
return fallbackTitleUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String fallbackTitle;
@JsonIgnore
private Supplier _fallbackTitleSupplier;
@Schema
public Boolean getHidden() {
if (_hiddenSupplier != null) {
hidden = _hiddenSupplier.get();
_hiddenSupplier = null;
}
return hidden;
}
public void setHidden(Boolean hidden) {
this.hidden = hidden;
_hiddenSupplier = null;
}
@JsonIgnore
public void setHidden(
UnsafeSupplier hiddenUnsafeSupplier) {
_hiddenSupplier = () -> {
try {
return hiddenUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected Boolean hidden;
@JsonIgnore
private Supplier _hiddenSupplier;
@Schema
public Long getId() {
if (_idSupplier != null) {
id = _idSupplier.get();
_idSupplier = null;
}
return id;
}
public void setId(Long id) {
this.id = id;
_idSupplier = null;
}
@JsonIgnore
public void setId(UnsafeSupplier idUnsafeSupplier) {
_idSupplier = () -> {
try {
return idUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected Long id;
@JsonIgnore
private Supplier _idSupplier;
@Schema
public Date getModifiedDate() {
if (_modifiedDateSupplier != null) {
modifiedDate = _modifiedDateSupplier.get();
_modifiedDateSupplier = null;
}
return modifiedDate;
}
public void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
_modifiedDateSupplier = null;
}
@JsonIgnore
public void setModifiedDate(
UnsafeSupplier modifiedDateUnsafeSupplier) {
_modifiedDateSupplier = () -> {
try {
return modifiedDateUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected Date modifiedDate;
@JsonIgnore
private Supplier _modifiedDateSupplier;
@Schema
public Boolean getReadOnly() {
if (_readOnlySupplier != null) {
readOnly = _readOnlySupplier.get();
_readOnlySupplier = null;
}
return readOnly;
}
public void setReadOnly(Boolean readOnly) {
this.readOnly = readOnly;
_readOnlySupplier = null;
}
@JsonIgnore
public void setReadOnly(
UnsafeSupplier readOnlyUnsafeSupplier) {
_readOnlySupplier = () -> {
try {
return readOnlyUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected Boolean readOnly;
@JsonIgnore
private Supplier _readOnlySupplier;
@Schema
public String getSchemaVersion() {
if (_schemaVersionSupplier != null) {
schemaVersion = _schemaVersionSupplier.get();
_schemaVersionSupplier = null;
}
return schemaVersion;
}
public void setSchemaVersion(String schemaVersion) {
this.schemaVersion = schemaVersion;
_schemaVersionSupplier = null;
}
@JsonIgnore
public void setSchemaVersion(
UnsafeSupplier schemaVersionUnsafeSupplier) {
_schemaVersionSupplier = () -> {
try {
return schemaVersionUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String schemaVersion;
@JsonIgnore
private Supplier _schemaVersionSupplier;
@Schema
public String getTitle() {
if (_titleSupplier != null) {
title = _titleSupplier.get();
_titleSupplier = null;
}
return title;
}
public void setTitle(String title) {
this.title = title;
_titleSupplier = null;
}
@JsonIgnore
public void setTitle(
UnsafeSupplier titleUnsafeSupplier) {
_titleSupplier = () -> {
try {
return titleUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String title;
@JsonIgnore
private Supplier _titleSupplier;
@Schema
@Valid
public Map getTitle_i18n() {
if (_title_i18nSupplier != null) {
title_i18n = _title_i18nSupplier.get();
_title_i18nSupplier = null;
}
return title_i18n;
}
public void setTitle_i18n(Map title_i18n) {
this.title_i18n = title_i18n;
_title_i18nSupplier = null;
}
@JsonIgnore
public void setTitle_i18n(
UnsafeSupplier, Exception>
title_i18nUnsafeSupplier) {
_title_i18nSupplier = () -> {
try {
return title_i18nUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected Map title_i18n;
@JsonIgnore
private Supplier> _title_i18nSupplier;
@Schema
public Integer getType() {
if (_typeSupplier != null) {
type = _typeSupplier.get();
_typeSupplier = null;
}
return type;
}
public void setType(Integer type) {
this.type = type;
_typeSupplier = null;
}
@JsonIgnore
public void setType(UnsafeSupplier typeUnsafeSupplier) {
_typeSupplier = () -> {
try {
return typeUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected Integer type;
@JsonIgnore
private Supplier _typeSupplier;
@Schema
public String getUserName() {
if (_userNameSupplier != null) {
userName = _userNameSupplier.get();
_userNameSupplier = null;
}
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
_userNameSupplier = null;
}
@JsonIgnore
public void setUserName(
UnsafeSupplier userNameUnsafeSupplier) {
_userNameSupplier = () -> {
try {
return userNameUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String userName;
@JsonIgnore
private Supplier _userNameSupplier;
@Schema
public String getVersion() {
if (_versionSupplier != null) {
version = _versionSupplier.get();
_versionSupplier = null;
}
return version;
}
public void setVersion(String version) {
this.version = version;
_versionSupplier = null;
}
@JsonIgnore
public void setVersion(
UnsafeSupplier versionUnsafeSupplier) {
_versionSupplier = () -> {
try {
return versionUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String version;
@JsonIgnore
private Supplier _versionSupplier;
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (!(object instanceof SXPElement)) {
return false;
}
SXPElement sxpElement = (SXPElement)object;
return Objects.equals(toString(), sxpElement.toString());
}
@Override
public int hashCode() {
String string = toString();
return string.hashCode();
}
public String toString() {
StringBundler sb = new StringBundler();
sb.append("{");
DateFormat liferayToJSONDateFormat = new SimpleDateFormat(
"yyyy-MM-dd'T'HH:mm:ss'Z'");
Map> actions = getActions();
if (actions != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"actions\": ");
sb.append(_toJSON(actions));
}
Date createDate = getCreateDate();
if (createDate != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"createDate\": ");
sb.append("\"");
sb.append(liferayToJSONDateFormat.format(createDate));
sb.append("\"");
}
String description = getDescription();
if (description != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"description\": ");
sb.append("\"");
sb.append(_escape(description));
sb.append("\"");
}
Map description_i18n = getDescription_i18n();
if (description_i18n != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"description_i18n\": ");
sb.append(_toJSON(description_i18n));
}
ElementDefinition elementDefinition = getElementDefinition();
if (elementDefinition != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"elementDefinition\": ");
sb.append(String.valueOf(elementDefinition));
}
String externalReferenceCode = getExternalReferenceCode();
if (externalReferenceCode != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"externalReferenceCode\": ");
sb.append("\"");
sb.append(_escape(externalReferenceCode));
sb.append("\"");
}
String fallbackDescription = getFallbackDescription();
if (fallbackDescription != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"fallbackDescription\": ");
sb.append("\"");
sb.append(_escape(fallbackDescription));
sb.append("\"");
}
String fallbackTitle = getFallbackTitle();
if (fallbackTitle != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"fallbackTitle\": ");
sb.append("\"");
sb.append(_escape(fallbackTitle));
sb.append("\"");
}
Boolean hidden = getHidden();
if (hidden != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"hidden\": ");
sb.append(hidden);
}
Long id = getId();
if (id != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"id\": ");
sb.append(id);
}
Date modifiedDate = getModifiedDate();
if (modifiedDate != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"modifiedDate\": ");
sb.append("\"");
sb.append(liferayToJSONDateFormat.format(modifiedDate));
sb.append("\"");
}
Boolean readOnly = getReadOnly();
if (readOnly != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"readOnly\": ");
sb.append(readOnly);
}
String schemaVersion = getSchemaVersion();
if (schemaVersion != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"schemaVersion\": ");
sb.append("\"");
sb.append(_escape(schemaVersion));
sb.append("\"");
}
String title = getTitle();
if (title != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"title\": ");
sb.append("\"");
sb.append(_escape(title));
sb.append("\"");
}
Map title_i18n = getTitle_i18n();
if (title_i18n != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"title_i18n\": ");
sb.append(_toJSON(title_i18n));
}
Integer type = getType();
if (type != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"type\": ");
sb.append(type);
}
String userName = getUserName();
if (userName != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"userName\": ");
sb.append("\"");
sb.append(_escape(userName));
sb.append("\"");
}
String version = getVersion();
if (version != null) {
if (sb.length() > 1) {
sb.append(", ");
}
sb.append("\"version\": ");
sb.append("\"");
sb.append(_escape(version));
sb.append("\"");
}
sb.append("}");
return sb.toString();
}
@Schema(
accessMode = Schema.AccessMode.READ_ONLY,
defaultValue = "com.liferay.search.experiences.rest.dto.v1_0.SXPElement",
name = "x-class-name"
)
public String xClassName;
private static String _escape(Object object) {
return StringUtil.replace(
String.valueOf(object), _JSON_ESCAPE_STRINGS[0],
_JSON_ESCAPE_STRINGS[1]);
}
private static boolean _isArray(Object value) {
if (value == null) {
return false;
}
Class> clazz = value.getClass();
return clazz.isArray();
}
private static String _toJSON(Map map) {
StringBuilder sb = new StringBuilder("{");
@SuppressWarnings("unchecked")
Set set = map.entrySet();
@SuppressWarnings("unchecked")
Iterator> iterator = set.iterator();
while (iterator.hasNext()) {
Map.Entry entry = iterator.next();
sb.append("\"");
sb.append(_escape(entry.getKey()));
sb.append("\": ");
Object value = entry.getValue();
if (_isArray(value)) {
sb.append("[");
Object[] valueArray = (Object[])value;
for (int i = 0; i < valueArray.length; i++) {
if (valueArray[i] instanceof Map) {
sb.append(_toJSON((Map)valueArray[i]));
}
else if (valueArray[i] instanceof String) {
sb.append("\"");
sb.append(valueArray[i]);
sb.append("\"");
}
else {
sb.append(valueArray[i]);
}
if ((i + 1) < valueArray.length) {
sb.append(", ");
}
}
sb.append("]");
}
else if (value instanceof Map) {
sb.append(_toJSON((Map)value));
}
else if (value instanceof String) {
sb.append("\"");
sb.append(_escape(value));
sb.append("\"");
}
else {
sb.append(value);
}
if (iterator.hasNext()) {
sb.append(", ");
}
}
sb.append("}");
return sb.toString();
}
private static final String[][] _JSON_ESCAPE_STRINGS = {
{"\\", "\"", "\b", "\f", "\n", "\r", "\t"},
{"\\\\", "\\\"", "\\b", "\\f", "\\n", "\\r", "\\t"}
};
private Map _extendedProperties;
}