- Type Parameters:
L- Property lookup typeC- Property category typeK- Property key type
- All Known Subinterfaces:
LCKPropertyResolver
public interface PropertyResolver<L,C,K>
Interface defining methods for retrieving properties from a configuration.
- Author:
- Ashley
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMax length for category valuesstatic final intMax length for key values -
Method Summary
Modifier and TypeMethodDescriptioncreatePropertyInfo(C category, K key, boolean modifiable, @NotNull PropertyType type) Create a new property inside the configuration.@NotNull Optional<?>getInternal(L lookup, @NotNull PropertyInfo info) Get an internal property inside the configuration.getPropertyByID(int id) Get the property linked to the specifiedid.getPropertyInfo(C category, K key) Get the property information for the specified property.@NotNull List<PropertyInfo>Get aListof all registered properties.booleanisPresent(L lookup, @NotNull PropertyInfo info) Check if the specified property is present in the configuration.booleanisRegistered(C category, K key) Check if the specified property exists inside the configuration.booleanputInternal(L lookup, @NotNull PropertyInfo info, @Nullable InputStream in) Put/Update an internal property inside the configuration.booleanremoveInternal(L lookup, @NotNull PropertyInfo info) Remove an internal value from the configuration.booleanremovePropertyInfo(@NotNull PropertyInfo info) Remove a property inside the configuration.booleanremovePropertyInfo(C category, K key) Remove a property inside the configuration.
-
Field Details
-
MAX_CATEGORY_LENGTH
static final int MAX_CATEGORY_LENGTHMax length for category values- See Also:
-
MAX_KEY_LENGTH
static final int MAX_KEY_LENGTHMax length for key values- See Also:
-
-
Method Details
-
createPropertyInfo
PropertyInfo createPropertyInfo(@NotNull C category, @NotNull K key, boolean modifiable, @NotNull @NotNull PropertyType type) throws PropertyException, IllegalArgumentException Create a new property inside the configuration.- Parameters:
category- - category of the propertykey- - property keymodifiable- - is the property user modifiabletype- - blob object type- Returns:
- Returns the created
PropertyInfo - Throws:
PropertyException- Thrown if the property already exists or there was an internal errorIllegalArgumentException- Thrown if the property already is registered
-
removePropertyInfo
Remove a property inside the configuration.- Parameters:
category- - category of the propertykey- - property key- Returns:
- Returns
trueif the property was deleted.falseotherwise
-
removePropertyInfo
Remove a property inside the configuration.- Parameters:
info- - property information- Returns:
- Returns
trueif the property was deleted.falseotherwise
-
isRegistered
Check if the specified property exists inside the configuration.- Parameters:
category- - category of the propertykey- - property key- Returns:
- Returns
trueif the property already exists inside the configuration - Throws:
PropertyException- Thrown if an internal error occurs
-
getPropertyByID
Get the property linked to the specifiedid.- Parameters:
id- - property id- Returns:
- Returns the
PropertyInfobound to the id - Throws:
PropertyException- Thrown if an internal error occursNoSuchElementException- Thrown if the specified property does not exist
-
getPropertyInfo
PropertyInfo getPropertyInfo(@NotNull C category, @NotNull K key) throws PropertyException, NoSuchElementException Get the property information for the specified property.- Parameters:
category- - category of the propertykey- - property key- Returns:
- Returns the
PropertyInfocontained in the configuration if present - Throws:
PropertyException- Thrown if an internal error occursNoSuchElementException- Thrown if the specified property does not exist
-
getPropertyList
Get aListof all registered properties.- Returns:
- Returns a
Listcontaining thePropertyInfoof all registered properties - Throws:
PropertyException- Thrown if an internal error occurs
-
removeInternal
boolean removeInternal(@NotNull L lookup, @NotNull @NotNull PropertyInfo info) throws PropertyException Remove an internal value from the configuration.- Parameters:
lookup- - property lookupinfo- - property information- Returns:
- Returns
trueif the property was successfully removed from the configuration - Throws:
PropertyException- Thrown if an internal error occurs- See Also:
-
putInternal
boolean putInternal(@NotNull L lookup, @NotNull @NotNull PropertyInfo info, @Nullable @Nullable InputStream in) throws PropertyException Put/Update an internal property inside the configuration.- Parameters:
lookup- - property lookupinfo- - property informationin- - data stream to write- Returns:
- Returns
trueif the property was successfully added/updated in the configuration - Throws:
PropertyException- Thrown if an internal error occurs- See Also:
-
getInternal
@NotNull @NotNull Optional<?> getInternal(@NotNull L lookup, @NotNull @NotNull PropertyInfo info) throws PropertyException Get an internal property inside the configuration.- Parameters:
lookup- - property lookupinfo- - property information- Returns:
- Returns an
Optionalcontaining raw value data - Throws:
PropertyException- Thrown if an internal error occurs- See Also:
-
isPresent
Check if the specified property is present in the configuration.Note: This method only checks if the property key was found. The property may still a
nullvalue- Parameters:
lookup- - property lookupinfo- - property information- Returns:
- Returns
trueif this property was found inside the configuration - Throws:
PropertyException- Thrown if an internal error occurs
-