001/*
002 * Copyright (c) 2016-2017 Chris K Wensel <chris@wensel.net>. All Rights Reserved.
003 * Copyright (c) 2007-2017 Xplenty, Inc. All Rights Reserved.
004 *
005 * Project and contact information: http://www.cascading.org/
006 *
007 * This file is part of the Cascading project.
008 *
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 *
013 *     http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 */
021
022package cascading.operation;
023
024/**
025 * Enum DebugLevel designates the level of a given {@link cascading.operation.Debug} instance. This is used in conjunction with the
026 * {@link cascading.flow.FlowConnector} to plan debug operations out of a particular {@link cascading.flow.Flow} instance.
027 * <p>
028 * Currently Debug can be denote either DEFAULT or VERBOSE. It is up to the developer to determine if a Debug operation
029 * should be at any given level.
030 */
031public enum DebugLevel implements PlannerLevel
032  {
033    NONE( 0 ),
034    DEFAULT( 1 ),
035    VERBOSE( 2 );
036
037  private final int rank;
038
039  DebugLevel( int rank )
040    {
041    this.rank = rank;
042    }
043
044  @Override
045  public boolean isNoneLevel()
046    {
047    return this == NONE;
048    }
049
050  @Override
051  public boolean isStricterThan( PlannerLevel plannerLevel )
052    {
053    return rank > ( (DebugLevel) plannerLevel ).rank;
054    }
055  }