![JAR search and dependency download from the Maven repository](/logo.png)
it.cnr.iit.jscontact.tools.dto.OnlineService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jscontact-tools Show documentation
Show all versions of jscontact-tools Show documentation
Java tools for JSContact building, validation, serialization/deserialization and conversion from vCard 4.0 (RFC6350) and its transliterations, namely xCard (RFC6351) and jCard (RFC7095).
/*
* Copyright (C) 2020 Consiglio Nazionale delle Ricerche
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package it.cnr.iit.jscontact.tools.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import it.cnr.iit.jscontact.tools.constraints.BooleanMapConstraint;
import it.cnr.iit.jscontact.tools.constraints.NotNullAnyConstraint;
import it.cnr.iit.jscontact.tools.constraints.UriConstraint;
import it.cnr.iit.jscontact.tools.dto.deserializers.ContextsDeserializer;
import it.cnr.iit.jscontact.tools.dto.interfaces.HasContexts;
import it.cnr.iit.jscontact.tools.dto.interfaces.HasLabel;
import it.cnr.iit.jscontact.tools.dto.interfaces.IdMapValue;
import it.cnr.iit.jscontact.tools.dto.interfaces.IsIANAType;
import it.cnr.iit.jscontact.tools.dto.serializers.ContextsSerializer;
import lombok.*;
import lombok.experimental.SuperBuilder;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Map;
/**
* Class mapping the OnlineService type as defined in section 2.3.2 of [RFC9553].
*
* @see Section 2.3.2 of RFC9553
* @author Mario Loffredo
*/
@NotNullAnyConstraint(fieldNames = {"uri", "user"}, message = "at least one not null member between uri and user is required in OnlineService")
@JsonPropertyOrder({"@type", "service", "uri", "user", "contexts", "pref", "label"})
@JsonInclude(JsonInclude.Include.NON_NULL)
@SuperBuilder
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class OnlineService extends AbstractJSContactType implements HasLabel, IsIANAType, IdMapValue, Serializable, HasContexts {
@Pattern(regexp = "OnlineService", message = "invalid @type value in OnlineService")
@JsonProperty("@type")
@Builder.Default
String _type = "OnlineService";
String service;
@UriConstraint
String uri;
String user;
@JsonSerialize(using = ContextsSerializer.class)
@JsonDeserialize(using = ContextsDeserializer.class)
@BooleanMapConstraint(message = "invalid Map contexts in OnlineService - Only Boolean.TRUE allowed")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
Map contexts;
@Min(value = 1, message = "invalid pref in OnlineService - value must be greater or equal than 1")
@Max(value = 100, message = "invalid pref in OnlineService - value must be less or equal than 100")
Integer pref;
String label;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy