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

nl.vpro.domain.constraint.media.MediaConstraints Maven / Gradle / Ivy

Go to download

Contains the objects used by the Frontend API, like forms and result objects

There is a newer version: 8.3.3
Show newest version
/*
 * Copyright (C) 2013 All rights reserved
 * VPRO The Netherlands
 */
package nl.vpro.domain.constraint.media;

import nl.vpro.domain.constraint.Constraint;
import nl.vpro.domain.constraint.Constraints;
import nl.vpro.domain.media.*;
import nl.vpro.domain.user.Broadcaster;

/**
 * @author Roelof Jan Koekoek
 * @since 2.0
 */
public class MediaConstraints {

    @SafeVarargs
    public static And and(Constraint... constraints) {
        return new And(constraints);
    }

    @SafeVarargs
    public static Or or(Constraint... constraints) {
        return new Or(constraints);
    }

    public static Not not(Constraint constraint) {
        return new Not(constraint);
    }

    public static Constraint alwaysTrue() {
        return Constraints.alwaysTrue();
    }

    public static Constraint alwaysFalse() {
        return Constraints.alwaysFalse();
    }
    public static AvFileFormatConstraint avFileFormat(AVFileFormat format) {
        return new AvFileFormatConstraint(format.name());
    }

    public static AvTypeConstraint avType(AVType type) {
        return new AvTypeConstraint(type);
    }

    public static BroadcasterConstraint broadcaster(Broadcaster broadcaster) {
        return broadcaster(broadcaster.getDisplayName());
    }

    public static BroadcasterConstraint broadcaster(String broadcaster) {
        return new BroadcasterConstraint(broadcaster);
    }

    public static DescendantOfConstraint descendantOf(DescendantRef ref) {
        return descendantOf(ref.getMidRef());
    }

    public static DescendantOfConstraint descendantOf(String ref) {
        return new DescendantOfConstraint(ref);
    }

    public static HasImageConstraint hasImage() {
        return new HasImageConstraint();
    }

    public static MediaTypeConstraint mediaType(MediaType type) {
        return new MediaTypeConstraint(type);
    }

    public static AVFileExtensionConstraint extension(String extension) {
        return new AVFileExtensionConstraint(extension);
    }

    public static HasLocationConstraint hasLocation(String platform) {
        HasLocationConstraint hasLocationConstraint = new HasLocationConstraint();
        hasLocationConstraint.setPlatform(platform);
        return hasLocationConstraint;
    }

    public static AgeRatingConstraint ageRating(AgeRating ageRating) {
        return new AgeRatingConstraint(ageRating);
    }

    public static ContentRatingConstraint contentRating(ContentRating contentRating) {
        return new ContentRatingConstraint(contentRating);
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy