Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EA86FE274 for ; Thu, 7 Feb 2013 20:16:07 +0000 (UTC) Received: (qmail 8491 invoked by uid 500); 7 Feb 2013 20:16:07 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 8367 invoked by uid 500); 7 Feb 2013 20:16:07 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 8358 invoked by uid 99); 7 Feb 2013 20:16:07 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2013 20:16:07 +0000 Received: from localhost (HELO mail-we0-f171.google.com) (127.0.0.1) (smtp-auth username britter, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2013 20:16:07 +0000 Received: by mail-we0-f171.google.com with SMTP id u54so2472037wey.30 for ; Thu, 07 Feb 2013 12:16:04 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.242.69 with SMTP id wo5mr5430528wjc.10.1360268164790; Thu, 07 Feb 2013 12:16:04 -0800 (PST) Received: by 10.194.236.161 with HTTP; Thu, 7 Feb 2013 12:16:04 -0800 (PST) Date: Thu, 7 Feb 2013 21:16:04 +0100 Message-ID: Subject: Re: svn commit: r1443696 - /commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java From: Benedikt Ritter To: Commons Developers List Content-Type: multipart/alternative; boundary=089e0122f0fec2f82904d5281cda --089e0122f0fec2f82904d5281cda Content-Type: text/plain; charset=ISO-8859-1 2013/2/7 > Author: britter > Date: Thu Feb 7 20:13:23 2013 > New Revision: 1443696 > > URL: http://svn.apache.org/r1443696 > Log: > Fixed checkstyle issues - no functional changes > > Modified: > > commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java > > Modified: > commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java > URL: > http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java?rev=1443696&r1=1443695&r2=1443696&view=diff > > ============================================================================== > --- > commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java > (original) > +++ > commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java > Thu Feb 7 20:13:23 2013 > @@ -33,14 +33,12 @@ public final class Argument > { > > /** > - * Factory method for arguments. Creates an argument by taking a > value and > - * determining the type of the given value. > + * Factory method for arguments. Creates an argument by taking a > value and determining the type of the given value. > * > - * @param value the value to be wrapped by the new argument object. > Must not > - * be {@code null}! If you want to create a null > argument use > - * {@link #nullArgument(Class)} instead. > + * @param value the value to be wrapped by the new argument object. > Must not be {@code null}! If you want to create > + * a null argument use {@link #nullArgument(Class)} > instead. > + * @param the type of the argument. > * @return a new argument of type {@code value.getClass()} > - * @throws NullPointerException if {@code value} is null > How do you feel about this? Checkstyle complains about this, and I think it is sufficient to tell users that an argument must not be null. Regards, Benedikt > */ > public static Argument argument( A value ) > { > @@ -51,11 +49,11 @@ public final class Argument > } > > /** > - * Creates a new null argument of the given type. > + * Creates a new null argument of the given type. Shortcut for {@code > argument( type, null )}. > * > - * @param type the type of the new argument > + * @param type the type of the new argument. Must not be {@code null}! > + * @param the type of argument. > * @return an argument with {@code value == null}. > - * @throws NullPointerException if {@code type} is null. > */ > public static Argument nullArgument( Class type ) > { > @@ -67,8 +65,9 @@ public final class Argument > * > * @param type the type of the new argument. Must not be {@code null}! > * @param value the value of the new argument. > + * @param the type of the argument. > + * @param the type of the value of the argument. > * @return a new argument of the given type with the given value. > - * @throws NullPointerException if {@code type} is null > */ > public static Argument argument( Class type, V > value ) > { > @@ -130,11 +129,24 @@ public final class Argument > this.value = value; > } > > + /** > + * Returns the argument's type. Note that the type returned maybe a > super type of the actual type of the value > + * returned by {@link #getValue()} depending on how the argument was > created. For example: > + *
{@code argument( Number.class, Integer.valueOf( 4 ) );}
> + * will create an argument with an Integer as Value but Number.class > as type. > + * > + * @return the argument's type > + */ > public Class getType() > { > return type; > } > > + /** > + * Returns the value of the argument. Maybe {@code null} if this is a > null argument. > + * > + * @return the value of the argument. > + */ > public T getValue() > { > return value; > > > --089e0122f0fec2f82904d5281cda--