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

nl.vpro.domain.api.profile.ProfileRepository Maven / Gradle / Ivy

package nl.vpro.domain.api.profile;

import java.util.Map;

import org.checkerframework.checker.nullness.qual.Nullable;

import nl.vpro.domain.media.MediaObject;
import nl.vpro.domain.page.Page;

/**
 * @author Michiel Meeuwissen
 * @since 2.0
 */
public interface ProfileRepository {

    @Nullable
    default Profile getProfile(String name) {
        if (name == null) {
            return null;
        }
        return getProfiles().get(name);
    }

    Map getProfiles();


    default  ProfileDefinition getPageProfileDefinition(String name) {
        if (name == null) {
            return null;
        }
        Profile profile = getProfile(name);
        return profile != null ? profile.getPageProfile() : null;
    }

    default  ProfileDefinition getMediaProfileDefinition(String name) {
        Profile profile = getProfile(name);
        return profile != null ? profile.getMediaProfile() : null;
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy