Class JcrPropertyMapCacheEntry
java.lang.Object
org.apache.sling.jcr.resource.internal.helper.JcrPropertyMapCacheEntry
-
Constructor Summary
ConstructorDescriptionJcrPropertyMapCacheEntry
(@NotNull Object value, @NotNull javax.jcr.Node node) Create a new cache entry from a value.JcrPropertyMapCacheEntry
(@NotNull javax.jcr.Property prop) Create a new cache entry from a property. -
Method Summary
Modifier and TypeMethodDescription<T> T
convertToType
(@NotNull Class<T> type, @NotNull javax.jcr.Node node, @Nullable ClassLoader dynamicClassLoader) Convert the default value to the given type@NotNull Object
Get the current property value.@Nullable Object
Get the current property value.boolean
isArray()
Whether this value is an array or not
-
Constructor Details
-
JcrPropertyMapCacheEntry
public JcrPropertyMapCacheEntry(@NotNull @NotNull javax.jcr.Property prop) throws javax.jcr.RepositoryException Create a new cache entry from a property.- Parameters:
prop
- the property- Throws:
javax.jcr.RepositoryException
- if the provided property cannot be converted to a Java Object
-
JcrPropertyMapCacheEntry
public JcrPropertyMapCacheEntry(@NotNull @NotNull Object value, @NotNull @NotNull javax.jcr.Node node) throws javax.jcr.RepositoryException Create a new cache entry from a value.- Parameters:
value
- the valuenode
- the node- Throws:
javax.jcr.RepositoryException
- if the provided value cannot be stored
-
-
Method Details
-
isArray
public boolean isArray()Whether this value is an array or not- Returns:
true
if an array.
-
getPropertyValue
Get the current property value.- Returns:
- The current value
- Throws:
javax.jcr.RepositoryException
- If something goes wrong
-
getPropertyValueOrNull
Get the current property value.- Returns:
- The current value or
null
if not possible.
-
convertToType
@Nullable public <T> T convertToType(@NotNull @NotNull Class<T> type, @NotNull @NotNull javax.jcr.Node node, @Nullable @Nullable ClassLoader dynamicClassLoader) Convert the default value to the given type- Type Parameters:
T
- The type- Parameters:
type
- The type classnode
- The nodedynamicClassLoader
- The classloader- Returns:
- The converted object
-