// Path: parser/src/main/java/io/lindstrom/mpd/support/ProfilesDeserializer.java
// public class ProfilesDeserializer extends JsonDeserializer<Profiles> {
//     @Override
//     public Profiles deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
//         String text = p.getText();
// 
//         List<Profile> profiles = new ArrayList<>();
//         List<String> others = new ArrayList<>();
// 
//         for (String identifier : text.split(",")) {
//             identifier = identifier.trim();
// 
//             try {
//                 profiles.add(Profile.fromIdentifier(identifier));
//             } catch (IllegalArgumentException e) {
//                 others.add(identifier);
//             }
//         }
// 
//         return new Profiles(profiles, others);
//     }
// }
// 
// Path: parser/src/main/java/io/lindstrom/mpd/support/ProfilesSerializer.java
// public class ProfilesSerializer extends JsonSerializer<Profiles> {
//     @Override
//     public void serialize(Profiles value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
//         List<String> list = new ArrayList<>();
//         value.getProfiles().forEach(profile -> list.add(profile.toString()));
//         list.addAll(value.getInteroperabilityPointsAndExtensions());
//         gen.writeString(String.join(",", list));
//     }
// }
// 
// Path: parser/src/main/java/io/lindstrom/mpd/support/Utils.java
// public class Utils {
//     public static <T> List<T> unmodifiableList(List<T> list) {
//         if (list == null) {
//             return List.of();
//         } else {
//             return List.copyOf(list);
//         }
//     }
// 
//     @SafeVarargs
//     public static <T> List<T> varargsToList(T head, T ...tail) {
//         if (tail.length == 0) {
//             return List.of(head);
//         } else {
//             List<T> list = new ArrayList<>();
//             list.add(head);
//             list.addAll(List.of(tail));
//             return List.copyOf(list);
//         }
//     }
// }


import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.lindstrom.mpd.support.ProfilesDeserializer;
import io.lindstrom.mpd.support.ProfilesSerializer;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects;
package io.lindstrom.mpd.data;



@JsonSerialize(using = ProfilesSerializer.class)
@JsonDeserialize(using = ProfilesDeserializer.class)
public class Profiles {
    private final List<Profile> profiles;
    private final List<String> interoperabilityPointsAndExtensions;

    public Profiles(List<Profile> profiles, List<String> interoperabilityPointsAndExtensions) {
        this.profiles = profiles;
// Path: parser/src/main/java/io/lindstrom/mpd/support/ProfilesDeserializer.java
// public class ProfilesDeserializer extends JsonDeserializer<Profiles> {
//     @Override
//     public Profiles deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
//         String text = p.getText();
// 
//         List<Profile> profiles = new ArrayList<>();
//         List<String> others = new ArrayList<>();
// 
//         for (String identifier : text.split(",")) {
//             identifier = identifier.trim();
// 
//             try {
//                 profiles.add(Profile.fromIdentifier(identifier));
//             } catch (IllegalArgumentException e) {
//                 others.add(identifier);
//             }
//         }
// 
//         return new Profiles(profiles, others);
//     }
// }
// 
// Path: parser/src/main/java/io/lindstrom/mpd/support/ProfilesSerializer.java
// public class ProfilesSerializer extends JsonSerializer<Profiles> {
//     @Override
//     public void serialize(Profiles value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
//         List<String> list = new ArrayList<>();
//         value.getProfiles().forEach(profile -> list.add(profile.toString()));
//         list.addAll(value.getInteroperabilityPointsAndExtensions());
//         gen.writeString(String.join(",", list));
//     }
// }
// 
// Path: parser/src/main/java/io/lindstrom/mpd/support/Utils.java
// public class Utils {
//     public static <T> List<T> unmodifiableList(List<T> list) {
//         if (list == null) {
//             return List.of();
//         } else {
//             return List.copyOf(list);
//         }
//     }
// 
//     @SafeVarargs
//     public static <T> List<T> varargsToList(T head, T ...tail) {
//         if (tail.length == 0) {
//             return List.of(head);
//         } else {
//             List<T> list = new ArrayList<>();
//             list.add(head);
//             list.addAll(List.of(tail));
//             return List.copyOf(list);
//         }
//     }
// }


// Path: parser/src/main/java/io/lindstrom/mpd/data/Profiles.java
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.lindstrom.mpd.support.ProfilesDeserializer;
import io.lindstrom.mpd.support.ProfilesSerializer;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects;

package io.lindstrom.mpd.data;



@JsonSerialize(using = ProfilesSerializer.class)
@JsonDeserialize(using = ProfilesDeserializer.class)
public class Profiles {
    private final List<Profile> profiles;
    private final List<String> interoperabilityPointsAndExtensions;

    public Profiles(List<Profile> profiles, List<String> interoperabilityPointsAndExtensions) {
        this.profiles = profiles;
        this.interoperabilityPointsAndExtensions = interoperabilityPointsAndExtensions;