Show
Ignore:
Timestamp:
04/14/09 12:34:34 (3 years ago)
Author:
amandel
Message:

Whitespace cleanup

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/java/org/jcoderz/commons/types/EmailAddress.java

    r1205 r1404  
    9191 * </pre> 
    9292 * 
    93  * <p>The maximum length of an email address is: 64+1+255 characters (local-part + @ + domain). 
    94  * The minimum length of an email address is: 1+1+4 characters (local-part + @ + domain).</p> 
     93 * <p>The maximum length of an email address is:  
     94 * 64+1+255 characters (local-part + @ + domain). 
     95 * The minimum length of an email address is:  
     96 * 1+1+4 characters (local-part + @ + domain).</p> 
    9597 * 
    9698 * <p>A valid list of top-level domains is defined by the IANA. A top-level 
     
    123125  private static final String LET_DIG = "[a-zA-Z0-9]"; 
    124126  private static final String LET_DIG_HYP = "[a-zA-Z0-9-]"; 
    125   private static final String RFC_LABEL = LET_DIG + LET_DIG_HYP + "{0,61}" + LET_DIG; 
    126   private static final String DOMAIN = RFC_LABEL + "(\\." + RFC_LABEL + ")*\\." + LETTER + "{2,6}"; 
     127  private static final String RFC_LABEL  
     128      = LET_DIG + LET_DIG_HYP + "{0,61}" + LET_DIG; 
     129  private static final String DOMAIN  
     130      = RFC_LABEL + "(\\." + RFC_LABEL + ")*\\." + LETTER + "{2,6}"; 
    127131 
    128132  //Combined together, these form the allowed email regexp allowed by RFC 2822: 
     
    141145   * @param email The email address. 
    142146   */ 
    143   public EmailAddress(String email) 
     147  public EmailAddress (String email) 
    144148  { 
    145149    Assert.notNull(email, "email"); 
     
    156160    { 
    157161      throw new ArgumentMalformedException("email", email, 
    158           "The local part is longer than " + MAX_LENGTH_LOCAL_PART + " characters!"); 
     162          "The local part is longer than " + MAX_LENGTH_LOCAL_PART  
     163          + " characters!"); 
    159164    } 
    160165    if (mail.length() - at - 1 > MAX_LENGTH_DOMAIN) 
    161166    { 
    162167      throw new ArgumentMalformedException("email", email, 
    163           "The domain is longer than " + MAX_LENGTH_DOMAIN + " characters!"); 
     168          "The domain is longer than " + MAX_LENGTH_DOMAIN  
     169          + " characters!"); 
    164170    } 
    165171    mLocalPart = mail.substring(0, at); 
     
    171177 
    172178  /** 
    173    * Factory method for converting a String into an instance of type EmailAddress. 
     179   * Factory method for converting a String into an instance of type  
     180   * EmailAddress. 
    174181   * 
    175182   * @param email the email address to parse 
     
    183190  /** 
    184191   * Returns the local part of the address. 
    185    * 
    186192   * @return the local part of the address. 
    187193   */ 
    188   public String getName() 
     194  public String getName () 
    189195  { 
    190196    return mLocalPart; 
     
    194200  /** 
    195201   * Returns the domain name of the address. 
    196    * 
    197202   * @return the domain name of the address. 
    198203   */ 
    199   public String getDomain() 
     204  public String getDomain () 
    200205  { 
    201206    return mDomain; 
     
    205210  /** 
    206211   * Returns the top-level domain name of the address. 
    207    * 
    208212   * @return the top-level domain name of the address. 
    209213   */ 
    210   public String getTopLevelDomain() 
     214  public String getTopLevelDomain () 
    211215  { 
    212216    return mTopLevelDomain; 
    213217  } 
    214218 
    215  
    216   /** 
    217    * Returns the full email address. 
    218    * 
    219    * @return the full email address. 
    220    */ 
    221   public String getAddress() 
    222   { 
    223     return mLocalPart + "@" + mDomain; 
    224   } 
    225219 
    226220  /** 
     
    228222   * @return the full email address. 
    229223   */ 
    230   public String toString() 
     224  public String getAddress () 
    231225  { 
    232226    return mLocalPart + "@" + mDomain; 
     
    234228 
    235229  /** 
     230   * Returns the full email address. 
     231   * @return the full email address. 
     232   */ 
     233  public String toString () 
     234  { 
     235    return mLocalPart + "@" + mDomain; 
     236  } 
     237 
     238  /** 
    236239   * Returns the true if this email address equals the other. 
     240   * @param obj the object to compare to. 
    237241   * @return the true if this email address equals the other. 
    238242   * @see java.lang.Object#equals(java.lang.Object) 
    239243   */ 
    240   public boolean equals(Object obj) 
     244  public boolean equals (Object obj) 
    241245  { 
    242246    boolean result = false; 
     
    261265   * @return the hash code for this email. 
    262266   */ 
    263   public int hashCode() 
     267  public int hashCode () 
    264268  { 
    265269    int hashCode = HashCodeUtil.hash(HashCodeUtil.SEED, mLocalPart);