Package custom_jfx_plugin.property
Interface Property<T>
- All Known Subinterfaces:
ObservableProperty<T>
public interface Property<T>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NotNull Property<T>create()Generate new instance of property without initial valuestatic <T> @NotNull Property<T>create(T initial) Generate new instance of property with initial valueget()Returns the property valuesdefault TReturns the property value, or it's replaced with a default valid contentdefault TReturns the property value, or it's replaced with a default valid contentdefault TReturns the property value, or throws an error if is not defineddefault TgetOrElseThrow(@NotNull String name) Returns the property value, or throws an error if is not defineddefault booleanCheck if the property contains a valid not null valuedefault booleanCheck if the property contains a valid not null valuedefault voidChange the property valuevoidChange the property value
-
Method Details
-
get
Returns the property values- Returns:
- the property value or
nullif value is not declared
-
set
Change the property value- Parameters:
newValue- the new property value
-
set
Change the property value- Parameters:
provider- the object provider
-
isPresent
default boolean isPresent()Check if the property contains a valid not null value- Returns:
trueif the value is valid orfalseotherwise
-
isNotPresent
default boolean isNotPresent()Check if the property contains a valid not null value- Returns:
trueif the value is null or is not defined orfalseotherwise
-
getOrElse
Returns the property value, or it's replaced with a default valid content- Parameters:
defaultValue- the valid value if the content value is not valid- Returns:
- the valid value
-
getOrElse
Returns the property value, or it's replaced with a default valid content- Parameters:
provider- the valid value if the content value is not valid- Returns:
- the valid value
-
getOrElseThrow
Returns the property value, or throws an error if is not defined- Returns:
- the valid value
-
getOrElseThrow
Returns the property value, or throws an error if is not defined- Parameters:
name- property name- Returns:
- the valid value
-
create
Generate new instance of property without initial value- Type Parameters:
T- property type value- Returns:
- property instance
-
create
Generate new instance of property with initial value- Type Parameters:
T- property type value- Returns:
- property instance
-