package org.xbib.io.webdav.common;

import org.xbib.io.webdav.api.DavConstants;

/**
 * <code>OrderingType</code> represents the
 * DAV:ordering-type property as defined by
 * <a href="http://www.ietf.org/rfc/rfc3648.txt">RFC 3648</a>. This property is
 * protected cannot be set using PROPPATCH. Its value may only be set by
 * including the Ordering-Type header with a MKCOL request or by submitting an
 * ORDERPATCH request.
 *
 * @see DavProperty#isInvisibleInAllprop()
 */
public class OrderingType extends HrefProperty {

    /**
     * Creates a <code>OrderingType</code> with the default type (e.g. default
     * value). The default value is specified to be "DAV:unordered".
     */
    public OrderingType() {
        this(null);
    }

    /**
     * Create an <code>OrderingType</code> with the given ordering.<br>
     * NOTE: the ordering-type property is defined to be protected.
     *
     * @param href href
     * @see DavProperty#isInvisibleInAllprop()
     */
    public OrderingType(String href) {
        // spec requires that the default value is 'DAV:unordered'
        super(DavPropertyName.create("ordering-type", DavConstants.NAMESPACE), (href != null) ? href : "DAV:unordered", true);
    }
}
