效果展示
原JavaBean类
package collection;
public class TestBean {
private String name;
private String[] attributes;
private int num;
private int[] map;
private int[][] maps;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String[] getAttributes() {
return attributes;
}
public void setAttributes(String[] attributes) {
this.attributes = attributes;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public int[] getMap() {
return map;
}
public void setMap(int[] map) {
this.map = map;
}
public int[][] getMaps() {
return maps;
}
public void setMaps(int[][] maps) {
this.maps = maps;
}
}
生成的JavaBean派生类
package collection;
import java.util.Optional;
import java.lang.String;
public class TestBeanOpt extends TestBean {
public Optional<String> optName() {
return Optional.ofNullable(getName());
}
public Optional<String[]> optAttributes() {
return Optional.ofNullable(getAttributes());
}
public Opt