src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java

Print this page
rev 10195 : 8048267: Replace uses of 'new Long()' with appropriate alternative across core classes
Reviewed-by: chegar, psandoz
Contributed-by: otaviojava@java.net


  79      * @exception NullPointerException if the <code>name</code>
  80      *                  is <code>null</code>.
  81      */
  82     public SolarisNumericUserPrincipal(String name) {
  83         if (name == null)
  84             throw new NullPointerException(rb.getString("provided.null.name"));
  85 
  86         this.name = name;
  87     }
  88 
  89     /**
  90      * Create a <code>SolarisNumericUserPrincipal</code> using a
  91      * long representation of the user's identification number (UID).
  92      *
  93      * <p>
  94      *
  95      * @param name the user identification number (UID) for this user
  96      *                  represented as a long.
  97      */
  98     public SolarisNumericUserPrincipal(long name) {
  99         this.name = (new Long(name)).toString();
 100     }
 101 
 102     /**
 103      * Return the user identification number (UID) for this
 104      * <code>SolarisNumericUserPrincipal</code>.
 105      *
 106      * <p>
 107      *
 108      * @return the user identification number (UID) for this
 109      *          <code>SolarisNumericUserPrincipal</code>
 110      */
 111     public String getName() {
 112         return name;
 113     }
 114 
 115     /**
 116      * Return the user identification number (UID) for this
 117      * <code>SolarisNumericUserPrincipal</code> as a long.
 118      *
 119      * <p>
 120      *
 121      * @return the user identification number (UID) for this
 122      *          <code>SolarisNumericUserPrincipal</code> as a long.
 123      */
 124     public long longValue() {
 125         return ((new Long(name)).longValue());
 126     }
 127 
 128     /**
 129      * Return a string representation of this
 130      * <code>SolarisNumericUserPrincipal</code>.
 131      *
 132      * <p>
 133      *
 134      * @return a string representation of this
 135      *          <code>SolarisNumericUserPrincipal</code>.
 136      */
 137     public String toString() {
 138         return(rb.getString("SolarisNumericUserPrincipal.") + name);
 139     }
 140 
 141     /**
 142      * Compares the specified Object with this
 143      * <code>SolarisNumericUserPrincipal</code>
 144      * for equality.  Returns true if the given object is also a
 145      * <code>SolarisNumericUserPrincipal</code> and the two




  79      * @exception NullPointerException if the <code>name</code>
  80      *                  is <code>null</code>.
  81      */
  82     public SolarisNumericUserPrincipal(String name) {
  83         if (name == null)
  84             throw new NullPointerException(rb.getString("provided.null.name"));
  85 
  86         this.name = name;
  87     }
  88 
  89     /**
  90      * Create a <code>SolarisNumericUserPrincipal</code> using a
  91      * long representation of the user's identification number (UID).
  92      *
  93      * <p>
  94      *
  95      * @param name the user identification number (UID) for this user
  96      *                  represented as a long.
  97      */
  98     public SolarisNumericUserPrincipal(long name) {
  99         this.name = Long.valueOf(name).toString();
 100     }
 101 
 102     /**
 103      * Return the user identification number (UID) for this
 104      * <code>SolarisNumericUserPrincipal</code>.
 105      *
 106      * <p>
 107      *
 108      * @return the user identification number (UID) for this
 109      *          <code>SolarisNumericUserPrincipal</code>
 110      */
 111     public String getName() {
 112         return name;
 113     }
 114 
 115     /**
 116      * Return the user identification number (UID) for this
 117      * <code>SolarisNumericUserPrincipal</code> as a long.
 118      *
 119      * <p>
 120      *
 121      * @return the user identification number (UID) for this
 122      *          <code>SolarisNumericUserPrincipal</code> as a long.
 123      */
 124     public long longValue() {
 125         return Long.valueOf(name);
 126     }
 127 
 128     /**
 129      * Return a string representation of this
 130      * <code>SolarisNumericUserPrincipal</code>.
 131      *
 132      * <p>
 133      *
 134      * @return a string representation of this
 135      *          <code>SolarisNumericUserPrincipal</code>.
 136      */
 137     public String toString() {
 138         return(rb.getString("SolarisNumericUserPrincipal.") + name);
 139     }
 140 
 141     /**
 142      * Compares the specified Object with this
 143      * <code>SolarisNumericUserPrincipal</code>
 144      * for equality.  Returns true if the given object is also a
 145      * <code>SolarisNumericUserPrincipal</code> and the two