🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.objects
Article #14722

"setter" zwracający obiekt

#14722
From: Przemek Pokrywka
Date: Tue, 06 Jun 2006 19:40
17 lines
1248 bytes
Witam,

Osoby zaznajomione z Javą znają pojęcie tzw. "settera" - metody służącej 
do ustawiania wartości jakiegoś atrybutu. Metody te standardowo nie 
zwracają żadnej wartości.

Co Państwo myślą o praktyce zwracania przez takie metody obiektu 
deklarującej je klasy? Tzn.

public AnObject setAttribute(AttributeType desiredAttributeValue) {
	attribute = desiredAttributeValue;
	return this;
}

--
Pozdrawiam,
Przemysław Pokrywka
Technical Details
Message-ID: <e64lni$6bn$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail
From: Przemek Pokrywka <adres@zastrzezony.com>
Newsgroups: pl.comp.objects
Subject: "setter" zwracający obiekt
Date: Tue, 06 Jun 2006 21:40:26 +0200
Organization: Onet.pl
Lines: 17
Message-ID: <e64lni$6bn$1@news.onet.pl>
NNTP-Posting-Host: 114.inet.polhost.pl
Mime-Version: 1.0
X-Trace: news.onet.pl 1149622834 6519 80.48.120.114 (6 Jun 2006 19:40:34 GMT)
X-Complaints-To: usenet@news.onet.pl
NNTP-Posting-Date: Tue, 6 Jun 2006 19:40:34 +0000 (UTC)
X-Sender: 5aB4pqMdeQG1O30L902dNmlAzoKeNKcS
X-Accept-Language: pl, en-us, en
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit