All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.lindstrom.mpd.data.Profiles Maven / Gradle / Ivy

There is a newer version: 0.13
Show newest version
package io.lindstrom.mpd.data;

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;

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

    public Profiles(List profiles, List interoperabilityPointsAndExtensions) {
        this.profiles = profiles;
        this.interoperabilityPointsAndExtensions = interoperabilityPointsAndExtensions;
    }

    Profiles() {
        this.profiles = null;
        this.interoperabilityPointsAndExtensions = null;
    }

    public List getProfiles() {
        return Utils.unmodifiableList(profiles);
    }

    public List getInteroperabilityPointsAndExtensions() {
        return Utils.unmodifiableList(interoperabilityPointsAndExtensions);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Profiles profiles1 = (Profiles) o;
        return Objects.equals(profiles, profiles1.profiles) &&
                Objects.equals(interoperabilityPointsAndExtensions, profiles1.interoperabilityPointsAndExtensions);
    }

    @Override
    public int hashCode() {
        return Objects.hash(profiles, interoperabilityPointsAndExtensions);
    }

    @Override
    public String toString() {
        return "Profiles{" +
                "profiles=" + profiles +
                ", interoperabilityPointsAndExtensions=" + interoperabilityPointsAndExtensions +
                '}';
    }

    public Builder buildUpon() {
        return new Builder()
                .withProfiles(profiles)
                .withInteroperabilityPointsAndExtensions(interoperabilityPointsAndExtensions);
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private List profiles;
        private List interoperabilityPointsAndExtensions;

        public Builder withProfiles(List profiles) {
            this.profiles = profiles;
            return this;
        }

        public Builder withInteroperabilityPointsAndExtensions(List interoperabilityPointsAndExtensions) {
            this.interoperabilityPointsAndExtensions = interoperabilityPointsAndExtensions;
            return this;
        }

        public Profiles build() {
            return new Profiles(profiles, interoperabilityPointsAndExtensions);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy