JavaFX 将 StringProperty [value: ""] 迁移到简单的 String

JavaFX migrate StringProperty [value: ""] to simple String

如何将 StringProperty 转换为 String?我只需要文本值。 但我的功能是向我展示“StringProperty [value: bbbbbb]” 我了解 JavaFX 特定的访问器语法和访问器。但我无法理解如何正确输入。

public class TestDelete {

private static StringProperty myTestValue = new SimpleStringProperty();

public static void main(String[] args) {
    setText();
}

private static void setText() {
    TestDelete testDelete = new TestDelete();
    String myText = "aaaaa bbbbbb";
    myTestValue = new SimpleStringProperty(myText.replaceAll(".* ", ""));
    System.out.println(myTestValue);
}

public void getmyTestValue() {
    myTestValue.get();
}

public void setmyTestValue(String newVal) {
    myTestValue.set(newVal);
}

public StringProperty myTestValueProperty() {
    return myTestValue;
}

}

简单字符串 属性 相当于

public class NewBean {
SimpleStringProperty id = new SimpleStringProperty();
SimpleStringProperty name = new SimpleStringProperty();

public NewBean(){
    
}

public String getId() {
    return id.get();
}

public SimpleStringProperty idProperty() {
    return id;
}

public void setId(String id) {
    this.id.set(id);
}

public String getName() {
    return name.get();
}

public SimpleStringProperty nameProperty() {
    return name;
}

public void setName(String name) {
    this.name.set(name);
}
}