001    /*
002     * Copyright 2015 UnboundID Corp.
003     * All Rights Reserved.
004     */
005    /*
006     * Copyright (C) 2015 UnboundID Corp.
007     *
008     * This program is free software; you can redistribute it and/or modify
009     * it under the terms of the GNU General Public License (GPLv2 only)
010     * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011     * as published by the Free Software Foundation.
012     *
013     * This program is distributed in the hope that it will be useful,
014     * but WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016     * GNU General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with this program; if not, see <http://www.gnu.org/licenses>.
020     */
021    package com.unboundid.ldap.sdk.unboundidds.extensions;
022    
023    
024    
025    /**
026     * <BLOCKQUOTE>
027     *   <B>NOTE:</B>  This class is part of the Commercial Edition of the UnboundID
028     *   LDAP SDK for Java.  It is not available for use in applications that
029     *   include only the Standard Edition of the LDAP SDK, and is not supported for
030     *   use in conjunction with non-UnboundID products.
031     * </BLOCKQUOTE>
032     * This enum defines a set of change type values that may be used in conjunction
033     * with the set notification destination extended request.
034     */
035    public enum SetNotificationDestinationChangeType
036    {
037      /**
038       * Indicates that the complete set of destination details should be replaced.
039       */
040      REPLACE(0),
041    
042    
043    
044      /**
045       * Indicates that the provided destination details should be added to the
046       * existing set.
047       */
048      ADD(1),
049    
050    
051    
052      /**
053       * Indicates tht the specified destination details should be removed from the
054       * notification destination.
055       */
056      DELETE(2);
057    
058    
059    
060      // The integer value for this change type.
061      private final int intValue;
062    
063    
064    
065      /**
066       * Creates a new set notification destination change type with the provided
067       * information.
068       *
069       * @param  intValue  The integer value for this change type.
070       */
071      private SetNotificationDestinationChangeType(final int intValue)
072      {
073        this.intValue = intValue;
074      }
075    
076    
077    
078      /**
079       * Retrieves the integer value for this set notification destination change
080       * type.
081       *
082       * @return  The integer value for this set notification destination change
083       *          type.
084       */
085      public int intValue()
086      {
087        return intValue;
088      }
089    
090    
091    
092      /**
093       * Retrieves the set notification destination change type with the specified
094       * integer value.
095       *
096       * @param  intValue  The integer value for the change type to retrieve.
097       *
098       * @return  The requested change type, or {@code null} if there is no change
099       *          type with the specified integer value.
100       */
101      public static SetNotificationDestinationChangeType valueOf(final int intValue)
102      {
103        for (final SetNotificationDestinationChangeType t : values())
104        {
105          if (t.intValue == intValue)
106          {
107            return t;
108          }
109        }
110    
111        return null;
112      }
113    }