001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License.
018 *
019 */
020package org.apache.directory.api.ldap.extras.controls.ad_impl;
021
022import org.apache.directory.api.asn1.ber.grammar.States;
023
024
025/**
026 * This class store the AdPolicyHints grammar constants. It is also
027 * used for debugging purposes.
028 *
029 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
030 */
031public enum AdPolicyHintsStates implements States
032{
033    /** Initial state */
034    START_STATE,
035
036    /** PolicyRequestValue ::= SEQUENCE transition */
037    AD_POLICY_HINTS_SEQUENCE_STATE,
038
039    /** flags INTEGER transition */
040    AD_POLICY_HINTS_FLAGS_STATE,
041
042    /** Final state */
043    END_STATE;
044
045    /**
046     * Get the grammar name
047     *
048     * @return The grammar name
049     */
050    public String getGrammarName()
051    {
052        return "AD POLICY_HINTS_GRAMMAR";
053    }
054
055
056    /**
057     * Get the string representing the state
058     *
059     * @param state The state number
060     * @return The String representing the state
061     */
062    public String getState( int state )
063    {
064        return ( state == END_STATE.ordinal() ) ? "AD_POLICY_HINTS_END_STATE" : name();
065    }
066
067
068    /**
069     * {@inheritDoc}
070     */
071    @Override
072    public boolean isEndState()
073    {
074        return this == END_STATE;
075    }
076
077
078    /**
079     * {@inheritDoc}
080     */
081    @Override
082    public Enum<?> getStartState()
083    {
084        return START_STATE;
085    }
086}