Class MultiGenericPropertyState

  • All Implemented Interfaces:
    org.apache.jackrabbit.oak.api.PropertyState

    public class MultiGenericPropertyState
    extends EmptyPropertyState
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<T> values  
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiGenericPropertyState​(java.lang.String name, java.lang.Iterable<java.lang.String> values, org.apache.jackrabbit.oak.api.Type<?> type)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int count()  
      static org.apache.jackrabbit.oak.api.PropertyState dateProperty​(java.lang.String name, java.lang.Iterable<java.lang.String> values)
      Create a multi valued PropertyState from a list of dates.
      Conversions.Converter getConverter​(java.lang.String value)
      Create a converter for converting a value to other types.
      org.apache.jackrabbit.oak.api.Type<?> getType()  
      <S> S getValue​(org.apache.jackrabbit.oak.api.Type<S> type)  
      <S> S getValue​(org.apache.jackrabbit.oak.api.Type<S> type, int index)  
      static org.apache.jackrabbit.oak.api.PropertyState nameProperty​(java.lang.String name, java.lang.Iterable<java.lang.String> values)
      Create a multi valued PropertyState from a list of names.
      static org.apache.jackrabbit.oak.api.PropertyState pathProperty​(java.lang.String name, java.lang.Iterable<java.lang.String> values)
      Create a multi valued PropertyState from a list of paths.
      static org.apache.jackrabbit.oak.api.PropertyState referenceProperty​(java.lang.String name, java.lang.Iterable<java.lang.String> values)
      Create a multi valued PropertyState from a list of references.
      long size​(int index)  
      static org.apache.jackrabbit.oak.api.PropertyState uriProperty​(java.lang.String name, java.lang.Iterable<java.lang.String> values)
      Create a multi valued PropertyState from a list of URIs.
      static org.apache.jackrabbit.oak.api.PropertyState weakreferenceProperty​(java.lang.String name, java.lang.Iterable<java.lang.String> values)
      Create a multi valued PropertyState from a list of weak references.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • values

        protected final java.util.List<T> values
    • Constructor Detail

      • MultiGenericPropertyState

        public MultiGenericPropertyState​(java.lang.String name,
                                         java.lang.Iterable<java.lang.String> values,
                                         org.apache.jackrabbit.oak.api.Type<?> type)
        Throws:
        java.lang.IllegalArgumentException - if type.isArray() is false
    • Method Detail

      • dateProperty

        public static org.apache.jackrabbit.oak.api.PropertyState dateProperty​(java.lang.String name,
                                                                               java.lang.Iterable<java.lang.String> values)
        Create a multi valued PropertyState from a list of dates.
        Parameters:
        name - The name of the property state
        values - The values of the property state
        Returns:
        The new property state of type Type.DATES
      • nameProperty

        public static org.apache.jackrabbit.oak.api.PropertyState nameProperty​(java.lang.String name,
                                                                               java.lang.Iterable<java.lang.String> values)
        Create a multi valued PropertyState from a list of names. No validation is performed on the strings passed for values.
        Parameters:
        name - The name of the property state
        values - The values of the property state
        Returns:
        The new property state of type Type.NAMES
      • pathProperty

        public static org.apache.jackrabbit.oak.api.PropertyState pathProperty​(java.lang.String name,
                                                                               java.lang.Iterable<java.lang.String> values)
        Create a multi valued PropertyState from a list of paths. No validation is performed on the strings passed for values.
        Parameters:
        name - The name of the property state
        values - The values of the property state
        Returns:
        The new property state of type Type.PATHS
      • referenceProperty

        public static org.apache.jackrabbit.oak.api.PropertyState referenceProperty​(java.lang.String name,
                                                                                    java.lang.Iterable<java.lang.String> values)
        Create a multi valued PropertyState from a list of references. No validation is performed on the strings passed for values.
        Parameters:
        name - The name of the property state
        values - The values of the property state
        Returns:
        The new property state of type Type.REFERENCES
      • weakreferenceProperty

        public static org.apache.jackrabbit.oak.api.PropertyState weakreferenceProperty​(java.lang.String name,
                                                                                        java.lang.Iterable<java.lang.String> values)
        Create a multi valued PropertyState from a list of weak references. No validation is performed on the strings passed for values.
        Parameters:
        name - The name of the property state
        values - The values of the property state
        Returns:
        The new property state of type Type.WEAKREFERENCES
      • uriProperty

        public static org.apache.jackrabbit.oak.api.PropertyState uriProperty​(java.lang.String name,
                                                                              java.lang.Iterable<java.lang.String> values)
        Create a multi valued PropertyState from a list of URIs. No validation is performed on the strings passed for values.
        Parameters:
        name - The name of the property state
        values - The values of the property state
        Returns:
        The new property state of type Type.URIS
      • getConverter

        public Conversions.Converter getConverter​(java.lang.String value)
        Create a converter for converting a value to other types.
        Parameters:
        value - The value to convert
        Returns:
        A converter for the value of this property
      • getType

        public org.apache.jackrabbit.oak.api.Type<?> getType()
      • getValue

        @NotNull
        public <S> S getValue​(org.apache.jackrabbit.oak.api.Type<S> type)
        Specified by:
        getValue in interface org.apache.jackrabbit.oak.api.PropertyState
        Overrides:
        getValue in class EmptyPropertyState
        Returns:
        An empty list if type.isArray() is true.
        Throws:
        java.lang.IllegalStateException - if type.isArray() is false.
        java.lang.IllegalArgumentException - if type is not one of the values defined in Type
      • getValue

        @NotNull
        public <S> S getValue​(org.apache.jackrabbit.oak.api.Type<S> type,
                              int index)
        Specified by:
        getValue in interface org.apache.jackrabbit.oak.api.PropertyState
        Overrides:
        getValue in class EmptyPropertyState
        Throws:
        java.lang.IllegalArgumentException - if type is not one of the values defined in Type or if type.isArray() is true
        java.lang.IndexOutOfBoundsException - if index >= count().
      • count

        public final int count()
        Specified by:
        count in interface org.apache.jackrabbit.oak.api.PropertyState
        Overrides:
        count in class EmptyPropertyState
        Returns:
        0
      • size

        public long size​(int index)
        Specified by:
        size in interface org.apache.jackrabbit.oak.api.PropertyState
        Overrides:
        size in class EmptyPropertyState