src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.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


  85         }
  86 
  87         this.name = name;
  88         this.primaryGroup = primaryGroup;
  89     }
  90 
  91     /**
  92      * Create a <code>UnixNumericGroupPrincipal</code> using a
  93      * long representation of the user's group identification number (GID).
  94      *
  95      * <p>
  96      *
  97      * @param name the user's group identification number (GID) for this user
  98      *                  represented as a long. <p>
  99      *
 100      * @param primaryGroup true if the specified GID represents the
 101      *                  primary group to which this user belongs.
 102      *
 103      */
 104     public UnixNumericGroupPrincipal(long name, boolean primaryGroup) {
 105         this.name = (new Long(name)).toString();
 106         this.primaryGroup = primaryGroup;
 107     }
 108 
 109     /**
 110      * Return the user's group identification number (GID) for this
 111      * <code>UnixNumericGroupPrincipal</code>.
 112      *
 113      * <p>
 114      *
 115      * @return the user's group identification number (GID) for this
 116      *          <code>UnixNumericGroupPrincipal</code>
 117      */
 118     public String getName() {
 119         return name;
 120     }
 121 
 122     /**
 123      * Return the user's group identification number (GID) for this
 124      * <code>UnixNumericGroupPrincipal</code> as a long.
 125      *
 126      * <p>
 127      *
 128      * @return the user's group identification number (GID) for this
 129      *          <code>UnixNumericGroupPrincipal</code> as a long.
 130      */
 131     public long longValue() {
 132         return ((new Long(name)).longValue());
 133     }
 134 
 135     /**
 136      * Return whether this group identification number (GID) represents
 137      * the primary group to which this user belongs.
 138      *
 139      * <p>
 140      *
 141      * @return true if this group identification number (GID) represents
 142      *          the primary group to which this user belongs,
 143      *          or false otherwise.
 144      */
 145     public boolean isPrimaryGroup() {
 146         return primaryGroup;
 147     }
 148 
 149     /**
 150      * Return a string representation of this
 151      * <code>UnixNumericGroupPrincipal</code>.
 152      *




  85         }
  86 
  87         this.name = name;
  88         this.primaryGroup = primaryGroup;
  89     }
  90 
  91     /**
  92      * Create a <code>UnixNumericGroupPrincipal</code> using a
  93      * long representation of the user's group identification number (GID).
  94      *
  95      * <p>
  96      *
  97      * @param name the user's group identification number (GID) for this user
  98      *                  represented as a long. <p>
  99      *
 100      * @param primaryGroup true if the specified GID represents the
 101      *                  primary group to which this user belongs.
 102      *
 103      */
 104     public UnixNumericGroupPrincipal(long name, boolean primaryGroup) {
 105         this.name = Long.valueOf(name).toString();
 106         this.primaryGroup = primaryGroup;
 107     }
 108 
 109     /**
 110      * Return the user's group identification number (GID) for this
 111      * <code>UnixNumericGroupPrincipal</code>.
 112      *
 113      * <p>
 114      *
 115      * @return the user's group identification number (GID) for this
 116      *          <code>UnixNumericGroupPrincipal</code>
 117      */
 118     public String getName() {
 119         return name;
 120     }
 121 
 122     /**
 123      * Return the user's group identification number (GID) for this
 124      * <code>UnixNumericGroupPrincipal</code> as a long.
 125      *
 126      * <p>
 127      *
 128      * @return the user's group identification number (GID) for this
 129      *          <code>UnixNumericGroupPrincipal</code> as a long.
 130      */
 131     public long longValue() {
 132         return Long.valueOf(name);
 133     }
 134 
 135     /**
 136      * Return whether this group identification number (GID) represents
 137      * the primary group to which this user belongs.
 138      *
 139      * <p>
 140      *
 141      * @return true if this group identification number (GID) represents
 142      *          the primary group to which this user belongs,
 143      *          or false otherwise.
 144      */
 145     public boolean isPrimaryGroup() {
 146         return primaryGroup;
 147     }
 148 
 149     /**
 150      * Return a string representation of this
 151      * <code>UnixNumericGroupPrincipal</code>.
 152      *