This functionality is available in Standard, Professional, Architect and Enterprise editions only. |
Setters and Getters are common operations that contain almost every Class. With the help of our modeling tool, set and get operations for Class attributes can be generated automatically.
To create a setter or a getter
There are two ways of creating a setter or a getter:
The names of created operations (setters) are combined according to the following format:
public void set + <attribute name> (<attribute type> <attribute name>)
If you have an attribute called x of type int, then the generated setter will look this way:
|
The names of created operations (getters) are combined according to the following format:
public <attribute type> get + <attribute name> ( )
If you have an attribute called x of type int, then the generated getter will look this way:
|