Callee side

With getters and setters With GetSet approach
public class Foo {

  private String myStr;
  private int myInt;


  /**
   * MyStr represent ....
   */
  public String getMyStr() {
    return myStr;
  }

  /**
   * Set MyStr property ....
   */
  public void setMyStr(String myStr) {
    this.myStr = myStr;
  }

  /**
   * MyInt represent ....
   */
  public int getMyInt() {
    return myInt;
  }

  /**
   * Set MyInt property ....
   */
  public void setMyInt(int myInt) {
    this.myInt = myInt;
  }
}
public class Foo {

  /**
   * myStr represent ....
   */
  public String myStr;

  /**
   * myInt represent ....
   */
  public int myInt;
}

Caller side

With getters and setters With GetSet approach
public class FooConsumer {

  ...

  public void doSomething(Foo foo) {
    String str = foo.getMyStr();
    ...
    foo.setMyStr(newValue);
  }

  ...
}
public class FooConsumer {

  ...

  public void doSomething(Foo foo) {
    String str = foo.myStr;
    ...
    foo.myStr = newValue;
  }

  ...
}