
com.liferay.headless.delivery.dto.v1_0.FragmentFieldText Maven / Gradle / Ivy
The newest version!
/**
* 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.headless.delivery.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.json.JSONFactoryUtil;
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 jakarta.annotation.Generated;
import jakarta.validation.Valid;
import jakarta.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Supplier;
/**
* @author Javier Gamarra
* @generated
*/
@Generated("")
@GraphQLName(
description = "Represents a fragment field with text.",
value = "FragmentFieldText"
)
@JsonFilter("Liferay.Vulcan")
@XmlRootElement(name = "FragmentFieldText")
public class FragmentFieldText implements Serializable {
public static FragmentFieldText toDTO(String json) {
return ObjectMapperUtil.readValue(FragmentFieldText.class, json);
}
public static FragmentFieldText unsafeToDTO(String json) {
return ObjectMapperUtil.unsafeReadValue(FragmentFieldText.class, json);
}
@io.swagger.v3.oas.annotations.media.Schema(
description = "A link to a fragment."
)
@Valid
public FragmentLink getFragmentLink() {
if (_fragmentLinkSupplier != null) {
fragmentLink = _fragmentLinkSupplier.get();
_fragmentLinkSupplier = null;
}
return fragmentLink;
}
public void setFragmentLink(FragmentLink fragmentLink) {
this.fragmentLink = fragmentLink;
_fragmentLinkSupplier = null;
}
@JsonIgnore
public void setFragmentLink(
UnsafeSupplier fragmentLinkUnsafeSupplier) {
_fragmentLinkSupplier = () -> {
try {
return fragmentLinkUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField(description = "A link to a fragment.")
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected FragmentLink fragmentLink;
@JsonIgnore
private Supplier _fragmentLinkSupplier;
@io.swagger.v3.oas.annotations.media.Schema(
description = "The fragment field's text."
)
@Valid
public Object getText() {
if (_textSupplier != null) {
text = _textSupplier.get();
_textSupplier = null;
}
return text;
}
public void setText(Object text) {
this.text = text;
_textSupplier = null;
}
@JsonIgnore
public void setText(UnsafeSupplier
© 2015 - 2025 Weber Informatics LLC | Privacy Policy