001/* 002 * Copyright 2012-2017 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright (C) 2015-2017 Ping Identity Corporation 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 */ 021package com.unboundid.ldap.sdk.unboundidds.extensions; 022 023 024 025/** 026 * This enum defines the set of possible values for the element of a 027 * multi-update result which indicates whether any updates were applied to 028 * server data. 029 * <BR> 030 * <BLOCKQUOTE> 031 * <B>NOTE:</B> This class, and other classes within the 032 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 033 * supported for use against Ping Identity, UnboundID, and Alcatel-Lucent 8661 034 * server products. These classes provide support for proprietary 035 * functionality or for external specifications that are not considered stable 036 * or mature enough to be guaranteed to work in an interoperable way with 037 * other types of LDAP servers. 038 * </BLOCKQUOTE> 039 * 040 * @see MultiUpdateExtendedResult 041 */ 042public enum MultiUpdateChangesApplied 043{ 044 /** 045 * Indicates that none of the changes contained in the multi-update request 046 * were applied to the server. 047 */ 048 NONE(0), 049 050 051 052 /** 053 * Indicates that all of the changes contained in the multi-update request 054 * were applied to the server. 055 */ 056 ALL(1), 057 058 059 060 /** 061 * Indicates that one or more changes from the multi-update request were 062 * applied, but at least one failure was also encountered. 063 */ 064 PARTIAL(2); 065 066 067 068 // The integer value associated with this changes applied value. 069 private final int intValue; 070 071 072 073 /** 074 * Creates a new multi-update changes applied value with the provided integer 075 * representation. 076 * 077 * @param intValue The integer value associated with this changes applied 078 * value. 079 */ 080 MultiUpdateChangesApplied(final int intValue) 081 { 082 this.intValue = intValue; 083 } 084 085 086 087 /** 088 * Retrieves the integer value associated with this changes applied value. 089 * 090 * @return The integer value associated with this changes applied value. 091 */ 092 public int intValue() 093 { 094 return intValue; 095 } 096 097 098 099 /** 100 * Retrieves the multi-update changes applied value with the specified integer 101 * value. 102 * 103 * @param intValue The integer value for the changes applied value to 104 * retrieve. 105 * 106 * @return The multi-update changes applied value with the specified integer 107 * value, or {@code null} if there is no changes applied value with 108 * the specified integer value. 109 */ 110 public static MultiUpdateChangesApplied valueOf(final int intValue) 111 { 112 for (final MultiUpdateChangesApplied v : values()) 113 { 114 if (intValue == v.intValue) 115 { 116 return v; 117 } 118 } 119 120 return null; 121 } 122}