001/*
002 * Copyright 2020-2024 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright 2020-2024 Ping Identity Corporation
007 *
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 *    http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing, software
015 * distributed under the License is distributed on an "AS IS" BASIS,
016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 * See the License for the specific language governing permissions and
018 * limitations under the License.
019 */
020/*
021 * Copyright (C) 2020-2024 Ping Identity Corporation
022 *
023 * This program is free software; you can redistribute it and/or modify
024 * it under the terms of the GNU General Public License (GPLv2 only)
025 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
026 * as published by the Free Software Foundation.
027 *
028 * This program is distributed in the hope that it will be useful,
029 * but WITHOUT ANY WARRANTY; without even the implied warranty of
030 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
031 * GNU General Public License for more details.
032 *
033 * You should have received a copy of the GNU General Public License
034 * along with this program; if not, see <http://www.gnu.org/licenses>.
035 */
036package com.unboundid.ldap.sdk.unboundidds;
037
038
039
040import com.unboundid.util.Debug;
041import com.unboundid.util.NotNull;
042import com.unboundid.util.Nullable;
043import com.unboundid.util.StaticUtils;
044
045
046
047/**
048 * This enum defines the set of fields that are supported for use with the
049 * {@link PasswordPolicyStateJSON} object.
050 * <BR>
051 * <BLOCKQUOTE>
052 *   <B>NOTE:</B>  This class, and other classes within the
053 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
054 *   supported for use against Ping Identity, UnboundID, and
055 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
056 *   for proprietary functionality or for external specifications that are not
057 *   considered stable or mature enough to be guaranteed to work in an
058 *   interoperable way with other types of LDAP servers.
059 * </BLOCKQUOTE>
060 */
061public enum PasswordPolicyStateJSONField
062{
063  /**
064   * The field (password-policy-dn) used to hold the DN of the user's password
065   * policy.
066   */
067  PASSWORD_POLICY_DN("password-policy-dn"),
068
069
070
071  /**
072   * The field (account-is-usable) used to indicate whether the user's account
073   * is considered usable.
074   */
075  ACCOUNT_IS_USABLE("account-is-usable"),
076
077
078
079  /**
080   * The field (account-usability-errors) used to hold information about any
081   * account usability errors.
082   */
083  ACCOUNT_USABILITY_ERRORS("account-usability-errors"),
084
085
086
087  /**
088   * The field (account-usability-warnings) used to hold information about any
089   * account usability warnings.
090   */
091  ACCOUNT_USABILITY_WARNINGS("account-usability-warnings"),
092
093
094
095  /**
096   * The field (account-usability-notices) used to hold information about any
097   * account usability notices.
098   */
099  ACCOUNT_USABILITY_NOTICES("account-usability-notices"),
100
101
102
103  /**
104   * The field (has-static-password) used to indicate whether the user has a
105   * static password.
106   */
107  HAS_STATIC_PASSWORD("has-static-password"),
108
109
110
111  /**
112   * The field (password-changed-time) used to hold the time the user's password
113   * was last changed.
114   */
115  PASSWORD_CHANGED_TIME("password-changed-time"),
116
117
118
119  /**
120   * The field (seconds-since-password-change) used to hold the length of time
121   * in seconds since the user's password was last changed.
122   */
123  SECONDS_SINCE_PASSWORD_CHANGE("seconds-since-password-change"),
124
125
126
127  /**
128   * The field (account-is-disabled) used to indicate whether the user's account
129   * has been administratively disabled.
130   */
131  ACCOUNT_IS_DISABLED("account-is-disabled"),
132
133
134
135  /**
136   * The field (account-is-not-yet-active) used to indicate whether the user's
137   * account is not yet active.
138   */
139  ACCOUNT_IS_NOT_YET_ACTIVE(
140       "account-is-not-yet-active"),
141
142
143
144  /**
145   * The field (account-activation-time) used to hold the time that the user's
146   * account will become active.
147   */
148  ACCOUNT_ACTIVATION_TIME("account-activation-time"),
149
150
151
152  /**
153   * The field (seconds-until-account-activation) used to hold the length of
154   * time in seconds until the user's account will become active.
155   */
156  SECONDS_UNTIL_ACCOUNT_ACTIVATION("seconds-until-account-activation"),
157
158
159
160  /**
161   * The field (seconds-since-account-activation) used to hold the length of
162   * time in seconds since the user's account became active.
163   */
164  SECONDS_SINCE_ACCOUNT_ACTIVATION("seconds-since-account-activation"),
165
166
167
168  /**
169   * The field (account-is-expired) used to indicate whether the user's account
170   * is expired.
171   */
172  ACCOUNT_IS_EXPIRED("account-is-expired"),
173
174
175
176  /**
177   * The field (account-expiration-time) used to hold the time that the user's
178   * account will expire.
179   */
180  ACCOUNT_EXPIRATION_TIME("account-expiration-time"),
181
182
183
184  /**
185   * The field (seconds-until-account-expiration) used to hold the length of
186   * time in seconds until the user's account will expire.
187   */
188  SECONDS_UNTIL_ACCOUNT_EXPIRATION("seconds-until-account-expiration"),
189
190
191
192  /**
193   * The field (seconds-since-account-expiration) used to hold the length of
194   * time in seconds since the user's account expired.
195   */
196  SECONDS_SINCE_ACCOUNT_EXPIRATION("seconds-since-account-expiration"),
197
198
199
200  /**
201   * The field (password-is-expired) used to indicate whether the user's
202   * password is expired.
203   */
204  PASSWORD_IS_EXPIRED("password-is-expired"),
205
206
207
208  /**
209   * The field (maximum-password-age-seconds) used to hold the maximum length of
210   * time in seconds that the user can keep the same password before it expires.
211   */
212  MAXIMUM_PASSWORD_AGE_SECONDS("maximum-password-age-seconds"),
213
214
215
216  /**
217   * The field (password-expiration-time) used to hold the time the user's
218   * password will (or did) expire.
219   */
220  PASSWORD_EXPIRATION_TIME("password-expiration-time"),
221
222
223
224  /**
225   * The field (seconds-until-password-expiration) used to hold the length of
226   * time in seconds until the user's password will expire.
227   */
228  SECONDS_UNTIL_PASSWORD_EXPIRATION("seconds-until-password-expiration"),
229
230
231
232  /**
233   * The field (seconds-since-password-expiration) used to hold the length of
234   * time in seconds since the user's password expired.
235   */
236  SECONDS_SINCE_PASSWORD_EXPIRATION("seconds-since-password-expiration"),
237
238
239
240  /**
241   * The field (password-expiration-warning-interval-seconds) used to hold the
242   * length of time before the user's password expires that they will be
243   * eligible to receive a warning about the upcoming expiration.
244   */
245  PASSWORD_EXPIRATION_WARNING_INTERVAL_SECONDS(
246       "password-expiration-warning-interval-seconds"),
247
248
249
250  /**
251   * The field (expire-passwords-without-warning) used to indicate whether the
252   * server may expire a user's password with issuing at least warning about the
253   * upcoming expiration.
254   */
255  EXPIRE_PASSWORDS_WITHOUT_WARNING("expire-passwords-without-warning"),
256
257
258
259  /**
260   * The field (password-expiration-warning-issued) used to indicate whether the
261   * user has been warned about an upcoming password expiration.
262   */
263  PASSWORD_EXPIRATION_WARNING_ISSUED("password-expiration-warning-issued"),
264
265
266
267  /**
268   * The field (password-expiration-warning-time) used to hold the time that the
269   * user will be eligible to receive (or first received) a warning about an
270   * upcoming password expiration.
271   */
272  PASSWORD_EXPIRATION_WARNING_TIME("password-expiration-warning-time"),
273
274
275
276  /**
277   * The field (seconds-until-password-expiration-warning) used to hold the
278   * length of time in seconds until the user is eligible to be warned about an
279   * upcoming password expiration.
280   */
281  SECONDS_UNTIL_PASSWORD_EXPIRATION_WARNING(
282       "seconds-until-password-expiration-warning"),
283
284
285
286  /**
287   * The field (seconds-since-password-expiration-warning) used to hold the
288   * length of time in seconds since the user was first warned about an upcoming
289   * password expiration.
290   */
291  SECONDS_SINCE_PASSWORD_EXPIRATION_WARNING(
292       "seconds-since-password-expiration-warning"),
293
294
295
296  /**
297   * The field (account-is-failure-locked) used to indicate whether the user's
298   * account is currently locked as a result of too many failed authentication
299   * attempts.
300   */
301  ACCOUNT_IS_FAILURE_LOCKED("account-is-failure-locked"),
302
303
304
305  /**
306   * The field (failure-lockout-count) used to hold the number of failed
307   * authentication attempts required to lock an account.
308   */
309  FAILURE_LOCKOUT_COUNT("failure-lockout-count"),
310
311
312
313  /**
314   * The field (current-authentication-failure-count) used to hold the user's
315   * current authentication failure count.
316   */
317  CURRENT_AUTHENTICATION_FAILURE_COUNT("current-authentication-failure-count"),
318
319
320
321  /**
322   * The field (remaining-authentication-failure-count) used to hold the
323   * remaining number of failed authentication attempts before the user's
324   * account will be locked.
325   */
326  REMAINING_AUTHENTICATION_FAILURE_COUNT(
327       "remaining-authentication-failure-count"),
328
329
330
331  /**
332   * The field (authentication-failure-times) used to hold the times of the
333   * outstanding failed authentication attempts.
334   */
335  AUTHENTICATION_FAILURE_TIMES("authentication-failure-times"),
336
337
338
339  /**
340   * The field (failure-lockout-time) used to hold the time the user's account
341   * was locked as a result of too many failed authentication attempts.
342   */
343  FAILURE_LOCKOUT_TIME("failure-lockout-time"),
344
345
346
347  /**
348   * The field (failure-lockout-duration-seconds) used to hold the length of
349   * time in seconds that an account will remain locked as a result of too many
350   * failed authentication attempts.
351   */
352  FAILURE_LOCKOUT_DURATION_SECONDS("failure-lockout-duration-seconds"),
353
354
355
356  /**
357   * The field (failure-lockout-expiration-time) used to hold the time the
358   * user's failure-locked account will be automatically unlocked.
359   */
360  FAILURE_LOCKOUT_EXPIRATION_TIME("failure-lockout-expiration-time"),
361
362
363
364  /**
365   * The field (seconds-remaining-in-failure-lockout) used to hold the length of
366   * time in seconds until the user's failure-locked account will remain locked.
367   */
368  SECONDS_REMAINING_IN_FAILURE_LOCKOUT("seconds-remaining-in-failure-lockout"),
369
370
371
372  /**
373   * The field (last-login-time) used to hold the time the user last
374   * authenticated to the server.
375   */
376  LAST_LOGIN_TIME("last-login-time"),
377
378
379
380  /**
381   * The field (seconds-since-last-login) used to hold the length of time in
382   * seconds that has passed since the user last authenticated.
383   */
384  SECONDS_SINCE_LAST_LOGIN("seconds-since-last-login"),
385
386
387
388  /**
389   * The field (last-login-ip-address) used to hold the IP address of the client
390   * from which the user last authenticated.
391   */
392  LAST_LOGIN_IP_ADDRESS("last-login-ip-address"),
393
394
395
396  /**
397   * The field (account-is-idle-locked) used to indicate whether the user's
398   * account is currently locked because it has been too long since they
399   * authenticated.
400   */
401  ACCOUNT_IS_IDLE_LOCKED("account-is-idle-locked"),
402
403
404
405  /**
406   * The field (idle-lockout-interval-seconds) used to hold the maximum length
407   * of time in seconds that may pass between successful authentications before
408   * the user's account will be locked.
409   */
410  IDLE_LOCKOUT_INTERVAL_SECONDS("idle-lockout-interval-seconds"),
411
412
413
414  /**
415   * The field (idle-lockout-time) used to hold the time that the user's account
416   * will be (or was) locked for allowing too much time to pass between
417   * successful authentications.
418   */
419  IDLE_LOCKOUT_TIME("idle-lockout-time"),
420
421
422
423  /**
424   * The field (seconds-until-idle-lockout) used to hold the length of time in
425   * seconds until the user's account will be locked for allowing too much time
426   * to pass between successful authentications.
427   */
428  SECONDS_UNTIL_IDLE_LOCKOUT("seconds-until-idle-lockout"),
429
430
431
432  /**
433   * The field (seconds-since-idle-lockout) used to hold the length of time in
434   * seconds since the user's account was locked for allowing too much time to
435   * pass between successful authentications.
436   */
437  SECONDS_SINCE_IDLE_LOCKOUT("seconds-since-idle-lockout"),
438
439
440
441  /**
442   * The field (must-change-password) used to indicate whether the user must
443   * change their password before they will be permitted to request any other
444   * operations in the server.
445   */
446  MUST_CHANGE_PASSWORD("must-change-password"),
447
448
449
450  /**
451   * The field (account-is-reset-locked) used to indicate whether the user's
452   * account is currently locked because they failed to choose a new password in
453   * a timely manner after an administrative reset.
454   */
455  ACCOUNT_IS_RESET_LOCKED("account-is-reset-locked"),
456
457
458
459  /**
460   * The field (force-change-on-add) used to indicate whether the user's
461   * password policy requires them to choose a new password the first time they
462   * authenticate after their account is created.
463   */
464  FORCE_CHANGE_ON_ADD("force-change-on-add"),
465
466
467
468  /**
469   * The field (force-change-on-reset) used to indicate whether the user's
470   * password policy requires them to choose a new password the first time they
471   * authenticate after their password is reset by an administrator.
472   */
473  FORCE_CHANGE_ON_RESET("force-change-on-reset"),
474
475
476
477  /**
478   * The field (maximum-password-reset-age-seconds) used to hold the maximum
479   * length of time in seconds that the user has to choose a new password after
480   * their account has been reset by an administrator before it will be locked.
481   */
482  MAXIMUM_PASSWORD_RESET_AGE_SECONDS("maximum-password-reset-age-seconds"),
483
484
485
486  /**
487   * The field (reset-lockout-time) used to hold the time at which the user's
488   * account will be locked if they do not choose a new password following an
489   * administrative reset.
490   */
491  RESET_LOCKOUT_TIME("reset-lockout-time"),
492
493
494
495  /**
496   * The field (seconds-until-reset-lockout) used to hold the length of time in
497   * seconds until the user's account will be locked if they do not choose a new
498   * password following an administrative reset.
499   */
500  SECONDS_UNTIL_RESET_LOCKOUT("seconds-until-reset-lockout"),
501
502
503
504  /**
505   * The field (maximum-password-history-count) used to hold the maximum number
506   * of passwords that the server will retain in the password history.
507   */
508  MAXIMUM_PASSWORD_HISTORY_COUNT("maximum-password-history-count"),
509
510
511
512  /**
513   * The field (maximum-password-history-duration-seconds) used to hold the
514   * maximum length of time in seconds that the server will retain passwords in
515   * the password history.
516   */
517  MAXIMUM_PASSWORD_HISTORY_DURATION_SECONDS(
518       "maximum-password-history-duration-seconds"),
519
520
521
522  /**
523   * The field (current-password-history-count) used to hold the number of
524   * passwords currently held in the user's password history.
525   */
526  CURRENT_PASSWORD_HISTORY_COUNT("current-password-history-count"),
527
528
529
530  /**
531   * The field (is-within-minimum-password-age) used to indicate whether the
532   * user is not permitted to change their password because they are within the
533   * minimum password age.
534   */
535  IS_WITHIN_MINIMUM_PASSWORD_AGE("is-within-minimum-password-age"),
536
537
538
539  /**
540   * The field (minimum-password-age-seconds) used to hold the minimum length of
541   * time in seconds that must pass between the time a user changes their
542   * password and the time they will be allowed to change it again.
543   */
544  MINIMUM_PASSWORD_AGE_SECONDS("minimum-password-age-seconds"),
545
546
547
548  /**
549   * The field (minimum-password-age-expiration-time) used to hold the earliest
550   * time that the user will be permitted to change their password following an
551   * earlier password change.
552   */
553  MINIMUM_PASSWORD_AGE_EXPIRATION_TIME("minimum-password-age-expiration-time"),
554
555
556
557  /**
558   * The field (seconds-remaining-in-minimum-password-age) used to hold the
559   * length of time in seconds that must pass before the user will be allowed to
560   * change their password following an earlier password change.
561   */
562  SECONDS_REMAINING_IN_MINIMUM_PASSWORD_AGE(
563       "seconds-remaining-in-minimum-password-age"),
564
565
566
567  /**
568   * The field (maximum-grace-login-count) used to hold the maximum number of
569   * grace login attempts that a user may have to change their password after it
570   * has expired.
571   */
572  MAXIMUM_GRACE_LOGIN_COUNT("maximum-grace-login-count"),
573
574
575
576  /**
577   * The field (used-grace-login-count) used to hold the number of grace logins
578   * that the user has currently used.
579   */
580  USED_GRACE_LOGIN_COUNT("used-grace-login-count"),
581
582
583
584  /**
585   * The field (remaining-grace-login-count) used to hold the number of
586   * remaining grace logins that the user has.
587   */
588  REMAINING_GRACE_LOGIN_COUNT("remaining-grace-login-count"),
589
590
591
592  /**
593   * The field (grace-login-use-times) used to hold the times that the user has
594   * used a grace login to authenticate.
595   */
596  GRACE_LOGIN_USE_TIMES("grace-login-use-times"),
597
598
599
600  /**
601   * The field (has-retired-password) used to indicate whether the user's
602   * account currently has a valid retired password.
603   */
604  HAS_RETIRED_PASSWORD("has-retired-password"),
605
606
607
608  /**
609   * The field (retired-password-expiration-time) used to hold the time that the
610   * user's retired password will expire.
611   */
612  RETIRED_PASSWORD_EXPIRATION_TIME("retired-password-expiration-time"),
613
614
615
616  /**
617   * The field (seconds-until-retired-password-expiration) used to hold the
618   * length of time in seconds remaining until the user's retired password will
619   * expire.
620   */
621  SECONDS_UNTIL_RETIRED_PASSWORD_EXPIRATION(
622       "seconds-until-retired-password-expiration"),
623
624
625
626  /**
627   * The field (require-secure-authentication) used to indicate whether the user
628   * is required to authenticate in a secure manner so that their credentials
629   * are not exposed to a third-party observer.
630   */
631  REQUIRE_SECURE_AUTHENTICATION("require-secure-authentication"),
632
633
634
635  /**
636   * The field (require-secure-password-changes) used to indicate whether the
637   * user is required to change their password in a secure manner that does not
638   * expose the credentials to a third-party observer.
639   */
640  REQUIRE_SECURE_PASSWORD_CHANGES("require-secure-password-changes"),
641
642
643
644  /**
645   * The field (available-sasl-mechanisms) used to hold the names of the SASL
646   * mechanisms that the user can use to authenticate.
647   */
648  AVAILABLE_SASL_MECHANISMS("available-sasl-mechanisms"),
649
650
651
652  /**
653   * The field (available-otp-delivery-mechanisms) used to hold the names of the
654   * one-time password delivery mechanisms that can be used to deliver one-time
655   * passwords, password reset tokens, or single-use tokens to the user.
656   */
657  AVAILABLE_OTP_DELIVERY_MECHANISMS("available-otp-delivery-mechanisms"),
658
659
660
661  /**
662   * The field (has-totp-shared-secret) used to indicate whether the user has
663   * any TOTP shared secrets registered with the server.
664   */
665  HAS_TOTP_SHARED_SECRET("has-totp-shared-secret"),
666
667
668
669  /**
670   * The field (has-registered-yubikey-otp-device) used to indicate whether the
671   * user has any YubiKey OTP devices registered with the server.
672   */
673  HAS_REGISTERED_YUBIKEY_OTP_DEVICE("has-registered-yubikey-otp-device"),
674
675
676
677  /**
678   * The field (account-is-validation-locked) used to indicate whether the
679   * user's account is currently locked because it contains a password that does
680   * not satisfy all of the configured password validators.
681   */
682  ACCOUNT_IS_VALIDATION_LOCKED("account-is-validation-locked"),
683
684
685
686  /**
687   * The field (last-bind-password-validation-time) used to hold the most recent
688   * time that password validation was performed during a bind operation for the
689   * user.
690   */
691  LAST_BIND_PASSWORD_VALIDATION_TIME("last-bind-password-validation-time"),
692
693
694
695  /**
696   * The field (seconds-since-last-bind-password-validation) used to hold the
697   * length of time in seconds since the most recent time that password
698   * validation was performed during a bind operation for the user.
699   */
700  SECONDS_SINCE_LAST_BIND_PASSWORD_VALIDATION(
701       "seconds-since-last-bind-password-validation"),
702
703
704
705  /**
706   * The field (minimum-bind-password-validation-frequency-seconds) used to hold
707   * the minimum length of time that should pass between invoking password
708   * validators during a bind operation for the user.
709   */
710  MINIMUM_BIND_PASSWORD_VALIDATION_FREQUENCY_SECONDS(
711       "minimum-bind-password-validation-frequency-seconds"),
712
713
714
715  /**
716   * The field (bind-password-validation-failure-action) used to indicate the
717   * action that the server should take if the bind password does not satisfy
718   * all of the configured password validators.
719   */
720  BIND_PASSWORD_VALIDATION_FAILURE_ACTION(
721       "bind-password-validation-failure-action"),
722
723
724
725  /**
726   * The field (recent-login-history) used to provide an encoded representation
727   * of the user's recent login history.
728   */
729  RECENT_LOGIN_HISTORY("recent-login-history"),
730
731
732
733  /**
734   * The field (maximum-recent-login-history-successful-authentication-count)
735   * used to hold the maximum number of recent successful login attempts the
736   * server should maintain for a user.
737   */
738  MAXIMUM_RECENT_LOGIN_HISTORY_SUCCESSFUL_AUTHENTICATION_COUNT(
739       "maximum-recent-login-history-successful-authentication-count"),
740
741
742
743  /**
744   * The field
745   * (maximum-recent-login-history-successful-authentication-duration-seconds)
746   * used to hold the maximum age in seconds of recent successful login attempts
747   * the server should maintain for a user.
748   */
749  MAXIMUM_RECENT_LOGIN_HISTORY_SUCCESSFUL_AUTHENTICATION_DURATION_SECONDS(
750       "maximum-recent-login-history-successful-authentication-duration-" +
751            "seconds"),
752
753
754
755  /**
756   * The field (maximum-recent-login-history-failed-authentication-count) used
757   * to hold the maximum number of recent failed login attempts the server
758   * should maintain for a user.
759   */
760  MAXIMUM_RECENT_LOGIN_HISTORY_FAILED_AUTHENTICATION_COUNT(
761       "maximum-recent-login-history-failed-authentication-count"),
762
763
764
765  /**
766   * The field
767   * (maximum-recent-login-history-failed-authentication-duration-seconds) used
768   * to hold the maximum age in seconds of recent failed login attempts the
769   * server should maintain for a user.
770   */
771  MAXIMUM_RECENT_LOGIN_HISTORY_FAILED_AUTHENTICATION_DURATION_SECONDS(
772       "maximum-recent-login-history-failed-authentication-duration-seconds"),
773
774
775
776  /**
777   * The field (password-quality-requirements) used to hold information about
778   * the requirements that passwords will be required to satisfy.
779   */
780  PASSWORD_QUALITY_REQUIREMENTS("password-quality-requirements"),
781
782
783
784  /**
785   * The field (has-password-encoded-with-non-current-settings) used to indicate
786   * whether the user has a password that is encoded with settings that don't
787   * match the current configuration for the associated password storage scheme.
788   */
789  HAS_PASSWORD_ENCODED_WITH_NON_CURRENT_SETTINGS(
790       "has-password-encoded-with-non-current-settings"),
791
792
793
794  /**
795   * The field (non-current-password-storage-scheme-settings-explanations) used
796   * to hold information about the reasons that a password may not be encoded
797   * with the current settings for the associated password storage scheme.
798   */
799  NON_CURRENT_PASSWORD_STORAGE_SCHEME_SETTINGS_EXPLANATIONS(
800       "non-current-password-storage-scheme-settings-explanations");
801
802
803
804  // The name for the JSON field.
805  @NotNull private final String fieldName;
806
807
808
809  /**
810   * Creates a new password policy state JSON field with the specified name.
811   *
812   * @param  fieldName  The name for the JSON field.
813   */
814  PasswordPolicyStateJSONField(@NotNull final String fieldName)
815  {
816    this.fieldName = fieldName;
817  }
818
819
820
821  /**
822   * Retrieves the name for the JSON field.
823   *
824   * @return  The name for the JSON field.
825   */
826  @NotNull()
827  public String getFieldName()
828  {
829    return fieldName;
830  }
831
832
833
834  /**
835   * Retrieves the password policy state JSON field value with the specified
836   * name.
837   *
838   * @param  name  The name of the password policy state JSON field value to
839   *               retrieve.  It must not be {@code null}.
840   *
841   * @return  The password policy state JSON field value with the specified
842   *          name, or {@code null} if there is no value with the specified
843   *          name.
844   */
845  @Nullable()
846  public static PasswordPolicyStateJSONField forName(@NotNull final String name)
847  {
848    try
849    {
850      final String transformedName =
851           StaticUtils.toUpperCase(name).replace('-', '_');
852      return valueOf(transformedName);
853    }
854    catch (final Exception e)
855    {
856      Debug.debugException(e);
857      return null;
858    }
859  }
860
861
862
863  /**
864   * Retrieves a string representation of this password policy state JSON field.
865   *
866   * @return  A string representation of this password policy state JSON field.
867   */
868  @Override()
869  @NotNull()
870  public String toString()
871  {
872    return fieldName;
873  }
874}