Setter

Noun · Development

Definitions

  1. A method (or language-level property accessor) that controls how a value is assigned to an object's internal field, allowing validation, transformation, or side effects on write — the counterpart to a getter.

    In plain English: A method that controls how a value gets set on an object, letting you add rules like validation before the change is saved.

    Example: "The setter on `price` rejects negative values and rounds to two decimal places before storing."

Related Terms