
com.liferay.headless.delivery.dto.v1_0.Option 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.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 = "The list of different possible values.", value = "Option"
)
@JsonFilter("Liferay.Vulcan")
@XmlRootElement(name = "Option")
public class Option implements Serializable {
public static Option toDTO(String json) {
return ObjectMapperUtil.readValue(Option.class, json);
}
public static Option unsafeToDTO(String json) {
return ObjectMapperUtil.unsafeReadValue(Option.class, json);
}
@io.swagger.v3.oas.annotations.media.Schema(
description = "The option's label."
)
public String getLabel() {
if (_labelSupplier != null) {
label = _labelSupplier.get();
_labelSupplier = null;
}
return label;
}
public void setLabel(String label) {
this.label = label;
_labelSupplier = null;
}
@JsonIgnore
public void setLabel(
UnsafeSupplier labelUnsafeSupplier) {
_labelSupplier = () -> {
try {
return labelUnsafeSupplier.get();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new RuntimeException(exception);
}
};
}
@GraphQLField(description = "The option's label.")
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String label;
@JsonIgnore
private Supplier _labelSupplier;
@io.swagger.v3.oas.annotations.media.Schema(
description = "The localized option's labels."
)
@Valid
public Map getLabel_i18n() {
if (_label_i18nSupplier != null) {
label_i18n = _label_i18nSupplier.get();
_label_i18nSupplier = null;
}
return label_i18n;
}
public void setLabel_i18n(Map label_i18n) {
this.label_i18n = label_i18n;
_label_i18nSupplier = null;
}
@JsonIgnore
public void setLabel_i18n(
UnsafeSupplier
© 2015 - 2025 Weber Informatics LLC | Privacy Policy