001 /*
002 * Copyright 2012-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 the set of possible values for the element of a
033 * multi-update result which indicates whether any updates were applied to
034 * server data.
035 *
036 * @see MultiUpdateExtendedResult
037 */
038 public enum MultiUpdateChangesApplied
039 {
040 /**
041 * Indicates that none of the changes contained in the multi-update request
042 * were applied to the server.
043 */
044 NONE(0),
045
046
047
048 /**
049 * Indicates that all of the changes contained in the multi-update request
050 * were applied to the server.
051 */
052 ALL(1),
053
054
055
056 /**
057 * Indicates that one or more changes from the multi-update request were
058 * applied, but at least one failure was also encountered.
059 */
060 PARTIAL(2);
061
062
063
064 // The integer value associated with this changes applied value.
065 private final int intValue;
066
067
068
069 /**
070 * Creates a new multi-update changes applied value with the provided integer
071 * representation.
072 *
073 * @param intValue The integer value associated with this changes applied
074 * value.
075 */
076 MultiUpdateChangesApplied(final int intValue)
077 {
078 this.intValue = intValue;
079 }
080
081
082
083 /**
084 * Retrieves the integer value associated with this changes applied value.
085 *
086 * @return The integer value associated with this changes applied value.
087 */
088 public int intValue()
089 {
090 return intValue;
091 }
092
093
094
095 /**
096 * Retrieves the multi-update changes applied value with the specified integer
097 * value.
098 *
099 * @param intValue The integer value for the changes applied value to
100 * retrieve.
101 *
102 * @return The multi-update changes applied value with the specified integer
103 * value, or {@code null} if there is no changes applied value with
104 * the specified integer value.
105 */
106 public static MultiUpdateChangesApplied valueOf(final int intValue)
107 {
108 for (final MultiUpdateChangesApplied v : values())
109 {
110 if (intValue == v.intValue)
111 {
112 return v;
113 }
114 }
115
116 return null;
117 }
118 }