Class StringValuePropertyDef

    • Constructor Detail

      • StringValuePropertyDef

        public StringValuePropertyDef​(String name)
        Constructor.
        Parameters:
        name - property name; also serves as the property ID
    • Method Detail

      • getPropertyValue

        public <V> V getPropertyValue​(Object obj,
                                      PropertyDef<V> propertyDef)
        Description copied from interface: PropertyExtractor
        Read the value of the property defined by propertyDef from the given object.
        Specified by:
        getPropertyValue in interface PropertyExtractor<Object>
        Type Parameters:
        V - value type
        Parameters:
        obj - Java object
        propertyDef - definition of which property to read
        Returns:
        property value
      • canSort

        public boolean canSort​(PropertyDef<?> propertyDef)
        Description copied from interface: SortingPropertyExtractor
        Determine if the given property can be sorted by this instance. If this method returns false, then the property's sorting resorts to the default behavior, i.e., depending on whether the property value implements Comparable.
        Specified by:
        canSort in interface SortingPropertyExtractor<Object>
        Parameters:
        propertyDef - definition of property
        Returns:
        true if the property defined by propertyDef can be sorted by this instance
      • sort

        public int sort​(PropertyDef<?> propertyDef,
                        Object obj1,
                        Object obj2)
        Description copied from interface: SortingPropertyExtractor
        Sort two values based on the given property.
        Specified by:
        sort in interface SortingPropertyExtractor<Object>
        Parameters:
        propertyDef - definition of property to sort on
        obj1 - first Java object
        obj2 - second Java object
        Returns:
        result of comparing obj1's property value to obj2's property value