Class JcrPropertyMapCacheEntry

java.lang.Object
org.apache.sling.jcr.resource.internal.helper.JcrPropertyMapCacheEntry

public class JcrPropertyMapCacheEntry extends Object
  • 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 value
      node - 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

      @NotNull public @NotNull Object getPropertyValue() throws javax.jcr.RepositoryException
      Get the current property value.
      Returns:
      The current value
      Throws:
      javax.jcr.RepositoryException - If something goes wrong
    • getPropertyValueOrNull

      @Nullable public @Nullable Object 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 class
      node - The node
      dynamicClassLoader - The classloader
      Returns:
      The converted object