Class JcrPropertyMapCacheEntry
java.lang.Object
org.apache.sling.jcr.resource.internal.helper.JcrPropertyMapCacheEntry
-
Constructor Summary
ConstructorsConstructorDescriptionJcrPropertyMapCacheEntry(@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> TconvertToType(@NotNull Class<T> type, @NotNull javax.jcr.Node node, @Nullable ClassLoader dynamicClassLoader) Convert the default value to the given type@NotNull ObjectGet the current property value.@Nullable ObjectGet the current property value.booleanisArray()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:
trueif 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
nullif 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
-