getter
A1Pronunciation
UK
- /ɡˈɛtə/
US
- /ˈɡɛtər/
Description
- one who obtains
- retriever
- data accessor
- one that collects
- gas absorber
A "getter" is someone or something that gets, collects, or brings back something. In computer programming, a getter is a method used to read data from an object. In technical equipment such as vacuum tubes, it can also mean a material that removes small amounts of gas. In older or more general use, the word can describe a person or thing that obtains something.
The word "getter" has a broad but clear set of meanings, all built around the idea of getting, taking in, or bringing back something. At its simplest, it can mean a person or thing that obtains something. That older, general sense appears in phrases such as "gold getter," meaning a person who goes out to find and collect gold.
Today, one of the most common uses appears in computer programming. In object-oriented code, a getter is a method that lets you read a value from an object. If an object stores a person's name, for example, a getter may return that name when another part of the program asks for it. In this sense, the word is practical and specific: it is simply the part that gives access to stored data.
The word also has a technical meaning in physics and engineering. In vacuum tubes and similar systems, a getter is a reactive material placed inside the device to remove leftover gas and help keep the vacuum clean. That use may sound very different from the programming sense, but the link is still the same basic idea: something is taking in or dealing with what is needed.
It is worth keeping one close relative separate. A "go-getter" is an ambitious, energetic person, but that is a different word and should not be confused with "getter" on its own. Across its main uses, "getter" usually points to a person, method, or material whose job is to obtain, retrieve, or remove something.
Examples
- 1
Class property
This class has a getter for the user's email address.
- 2
Getter and setter
We added a setter, but we left the getter read-only.
Domain
In programming, getter and setter
a pair of functions used to read and change a value
- 3
Custom formatting
The property uses a custom getter to return the date in a friendlier format.
Forms and spellings
1 form open this card.
Main spelling
- getter