Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014 Philip Helger (www.helger.com) philip[at]helger[dot]com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package com.helger.appbasics.security.password.constraint;
Password constraint defining the minimum length (incl.)

Author(s):
Philip Helger
  private static final String ATTR_MIN_LENGTH = "minlength";
  private final int m_nMinLength;

  
Ctor

Parameters:
nMinLength The minimum length to use. Must be > 0. If 0 should be allowed, simply don't use the constraint!
  public PasswordConstraintMinLength (@Nonnegative final int nMinLength)
  {
     = ValueEnforcer.isGT0 (nMinLength"MinLength");
  }
  public int getMinLength ()
  {
    return ;
  }
  public boolean isPasswordValid (@Nullable final String sPlainTextPassword)
  {
    return StringHelper.getLength (sPlainTextPassword) >= ;
  }
  public String getDescription (@Nonnull final Locale aContentLocale)
  {
                                                                           Integer.valueOf ());
  }
  public void fillMicroElement (@Nonnull final IMicroElement aElement)
  {
  }
  public boolean equals (final Object o)
  {
    if (o == this)
      return true;
    if (o == null || !getClass ().equals (o.getClass ()))
      return false;
    return  == rhs.m_nMinLength;
  }
  public int hashCode ()
  {
    return new HashCodeGenerator (this).append ().getHashCode ();
  }
  public String toString ()
  {
    return new ToStringGenerator (this).append ("minLength").toString ();
  }
New to GrepCode? Check out our FAQ X