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

nl.vpro.domain.api.media.MediaSortOrder 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
package nl.vpro.domain.api.media;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

import javax.xml.bind.annotation.*;

import com.fasterxml.jackson.annotation.JsonProperty;

import nl.vpro.domain.api.Order;

/**
 * @author Michiel Meeuwissen
 */
@XmlType(name = "mediaSortType")
@XmlAccessorType(XmlAccessType.NONE)
@ToString
@EqualsAndHashCode
public class MediaSortOrder {

    @XmlValue
    @JsonProperty("field")
    @Getter
    private MediaSortField field;

    @XmlAttribute
    @Getter
    private Order order;

    public static MediaSortOrder asc(MediaSortField field) {
        return new MediaSortOrder(field, Order.ASC);
    }


    public static MediaSortOrder desc(MediaSortField field) {
        return new MediaSortOrder(field, Order.DESC);
    }

    public MediaSortOrder(MediaSortField field, Order order) {
        this.field = field;
        this.order = order == null ? Order.ASC : order;
    }

    public MediaSortOrder(MediaSortField field) {
        this(field, Order.ASC);
    }
    protected MediaSortOrder() {

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy