Adding Accessor and Mutator in Raptor flowchart


In this post, we will discuss adding accessor and mutator methods to a class in the Raptor flow chart. The accessor method allows getting the variable value to the caller. The Mutator method is used to change the object variable.

Accessor method

Right-click on the class object >> Edit members

Click on the new method button.

Add the name of the method, return type, and Access of the getter method. The getter methods do not accept any method parameters. The return type of the method should match the data type of the corresponding class filed. For example


public String getModel()


Mutator method

The setter method is used to change the value of the class field. The method returns void and accepts the parameter of the same datatype as the class field.




Assigning the value of the setter method parameter to the class variable.




Adding accessor and mutator methods to a Java class