001/*
002 * (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl-2.1.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nicolas Chapurlat <nchapurlat@nuxeo.com>
016 */
017
018package org.nuxeo.ecm.core.io.registry.context;
019
020/**
021 * Possible depth values for "marshaller-to-marshaller" calls (to avoid the infinite loops).
022 *
023 * @since 7.2
024 */
025public enum DepthValues {
026
027    /**
028     * Loads / Fetches / Enriches the first level element(s).
029     */
030    root,
031
032    /**
033     * Loads / Fetches / Enriches the first level element(s) and its (their) children.
034     */
035    children,
036
037    /**
038     * Loads / Fetches / Enriches the first level element(s), its (their) children, and the grandchildren.
039     */
040    max;
041
042    /**
043     * Gets the corresponding depth value.
044     *
045     * @return The depth.
046     * @since 7.2
047     */
048    public int getDepth() {
049        return ordinal() + 1;
050    }
051
052}