类 BooleanProperty
java.lang.Object
com.iohao.game.common.kit.beans.property.BooleanProperty
- 所有已实现的接口:
PropertyValueObservable<Boolean>
bool - 属性具备监听特性。当值发生变更时,会触发监听事件。
var property = new BooleanProperty();
// add listener monitor property object
property.addListener((observable, oldValue, newValue) -> {
log.info("oldValue:{}, newValue:{}", oldValue, newValue);
});
property.get(); // value is false
property.set(true); // When the value changes,listeners are triggered
property.get(); // value is true
- 作者:
- 渔民小镇
- 日期:
- 2024-04-17
-
字段概要
-
构造器概要
-
方法概要
修饰符和类型方法说明void
addListener
(PropertyChangeListener<? super Boolean> listener) add ChangeListenerboolean
get()
get current valuegetValue()
get PropertyValueprotected void
void
removeListener
(PropertyChangeListener<? super Boolean> listener) remove ChangeListenervoid
set
(boolean newValue) set current valuevoid
set value
-
字段详细资料
-
valid
protected boolean valid
-
-
构造器详细资料
-
BooleanProperty
public BooleanProperty() -
BooleanProperty
public BooleanProperty(boolean value)
-
-
方法详细资料
-
getValue
从接口复制的说明:PropertyValueObservable
get PropertyValue- 返回:
- current value
-
setValue
从接口复制的说明:PropertyValueObservable
set value- 参数:
value
- value
-
get
public boolean get()get current value- 返回:
- current value
-
set
public void set(boolean newValue) set current value- 参数:
newValue
- current new value
-
addListener
从接口复制的说明:PropertyValueObservable
add ChangeListener- 指定者:
addListener
在接口中PropertyValueObservable<T>
- 参数:
listener
- ChangeListener
-
removeListener
从接口复制的说明:PropertyValueObservable
remove ChangeListener- 指定者:
removeListener
在接口中PropertyValueObservable<T>
- 参数:
listener
- ChangeListener
-
markInvalid
protected void markInvalid()
-