Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5E6C10518 for ; Thu, 23 Jan 2014 11:10:53 +0000 (UTC) Received: (qmail 66557 invoked by uid 500); 23 Jan 2014 11:10:51 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 65935 invoked by uid 500); 23 Jan 2014 11:10:50 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 64874 invoked by uid 99); 23 Jan 2014 11:10:48 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jan 2014 11:10:48 +0000 Received: from localhost (HELO mail-wi0-f180.google.com) (127.0.0.1) (smtp-auth username britter, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jan 2014 11:10:47 +0000 Received: by mail-wi0-f180.google.com with SMTP id d13so1622864wiw.1 for ; Thu, 23 Jan 2014 03:10:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wk54p1FXjdMi9Jq18sYEic0KEYLb9ROH0qqn5/pODZI=; b=WwOScs+LQOsP8qswmPv7/ZqqhQOEVxdduv0rrkHMa5UyCs2C9+tSimUfYqo5dbe7pZ LZ70Kgln08DVAMoCdPkSHRgXABePKu5Bo7Ck3XW7jSQRwQKMxWfePYgujKTVu4R9pbwM 0j1gL1+E6eGUKmtbiuQSr4orCMHDOynchqr9md2EgQ3aZVqEsG9fCPZTrBOjULLsgZWr VoJE6SRAJ4H6Y92MP4cXyGXkO+OMI4u43BDa7hlgOcgSJ9b9cXl0/HHLawpDu7t36IWB nXHJrjbVwNuO+3blNIaJXlry1AxQRAhU1PNG5TkWEQzhqRgwgoAKWXsYZAeU67vzGvVi ZMTw== MIME-Version: 1.0 X-Received: by 10.180.98.199 with SMTP id ek7mr7304733wib.21.1390475446207; Thu, 23 Jan 2014 03:10:46 -0800 (PST) Received: by 10.194.6.231 with HTTP; Thu, 23 Jan 2014 03:10:46 -0800 (PST) In-Reply-To: References: Date: Thu, 23 Jan 2014 12:10:46 +0100 Message-ID: Subject: Re: [beanutils] How can reset all the properties value? From: Benedikt Ritter To: Commons Users List Content-Type: multipart/alternative; boundary=f46d041826a00aa65d04f0a14b14 --f46d041826a00aa65d04f0a14b14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2014/1/23 Eric Chow > Hello, > > Is it possible to reset all the properties to the new instance default > value? > What do you mean by default values? The values that get assigned during construction of the object? You could use: MyBean beanToReset =3D ...; BeanUtils.copyProperties(beanToReset, new MyBean()); keep in mind that there are some restrictions when copying properties. See the JavaDoc of BeanUtilsBean.copyProperties [1] HTH, Benedikt [1] http://commons.apache.org/proper/commons-beanutils/javadocs/v1.9.1/apidocs/= org/apache/commons/beanutils/BeanUtilsBean.html > > Best regards, > Eric > --=20 http://people.apache.org/~britter/ http://www.systemoutprintln.de/ http://twitter.com/BenediktRitter http://github.com/britter --f46d041826a00aa65d04f0a14b14--