类 StringProperty

java.lang.Object
com.iohao.game.common.kit.beans.property.StringProperty
所有已实现的接口:
PropertyValueObservable<String>

public final class StringProperty extends Object
String - 属性具备监听特性。当值发生变更时,会触发监听事件。

         var property = new StringProperty();
         // add listener monitor property object
         property.addListener((observable, oldValue, newValue) -> {
             log.info("oldValue:{}, newValue:{}", oldValue, newValue);
         });

         property.get(); // value is null
         property.set("22"); // When the value changes,listeners are triggered
         property.get(); // value is "22"
 
 
作者:
渔民小镇
日期:
2024-04-17