Module watamebot
Package net.foxgenesis.property
Interface ImmutableProperty<K,F,M extends IPropertyMapping>
- Type Parameters:
K- Key type that points to a propertyF- Lookup data type that coincides property lookupM- Property mapping type that turns the raw property data into a usable type
- All Known Subinterfaces:
IProperty<K,L, M>
- All Known Implementing Classes:
GuildProperty
public interface ImmutableProperty<K,F,M extends IPropertyMapping>
An interface that provides generic methods used to retrieve and set
properties from various data structures.
- Author:
- Ashley
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet this property's data wrapped in anIPropertyMapping.default <U> UGet this property's value by applying the mapping into theresolverfunction.default <U> UGet this property's value by applying the mapping into theresolverfunction or returning the fallback suppliers value if theresolver's result isnull.default <U> UGet this property's value by applying the mapping into theresolverfunction or returning the fallback value if theresolver's result isnull.getKey()Get the key pointing to the property.booleanCheck if this property is end user editable.booleanCheck if this property is present.
-
Method Details
-
get
Get this property's data wrapped in anIPropertyMapping.- Parameters:
from- - property lookup data- Returns:
- The property's data inside an
IPropertyMapping
-
get
@Nullable default <U> U get(@NotNull F from, @NotNull @NotNull Supplier<U> fallback, @NotNull @NotNull Function<? super M, ? extends U> resolver) Get this property's value by applying the mapping into theresolverfunction or returning the fallback suppliers value if theresolver's result isnull.- Type Parameters:
U- - returned data type of theresolver- Parameters:
from- - property lookup datafallback- - supplier providing a fallback valueresolver- - function to resolve the mapping into a usable data type- Returns:
- Returns the property's value by applying it using the
resolverfunction. If the result of theresolverfunction isnull, thefallbacksupplier's value will be returned instead
-
get
@Nullable default <U> U get(@NotNull F from, @Nullable U fallback, @NotNull @NotNull Function<? super M, ? extends U> resolver) Get this property's value by applying the mapping into theresolverfunction or returning the fallback value if theresolver's result isnull.- Type Parameters:
U- - returned data type of theresolver- Parameters:
from- - property lookup datafallback- - fallback valueresolver- - function to resolve the mapping into a usable data type- Returns:
- Returns the property's value by applying it using the
resolverfunction. If the result of theresolverfunction isnull, thefallbackvalue will be returned instead
-
get
Get this property's value by applying the mapping into theresolverfunction.- Type Parameters:
U- - returned data type of theresolver- Parameters:
from- - property lookup dataresolver- - function to resolve the mapping into a usable data type- Returns:
- Returns the property's value by applying the mapping into the
resolverfunction.
-
getKey
Get the key pointing to the property.- Returns:
- The property's key
-
isPresent
Check if this property is present.- Parameters:
from- - lookup data- Returns:
- Returns
trueif the property was found using the provided lookup data
-
isEditable
boolean isEditable()Check if this property is end user editable.- Returns:
- Returns
trueif this property is allowed to be modified by the end user
-