Class SimpleNullableAttribute<O,​A>

    • Constructor Detail

      • SimpleNullableAttribute

        public SimpleNullableAttribute​(String attributeName)
        Creates an attribute with the given name. This name is not actually used by the query engine except in providing informative exception and debug messages. As such it is recommended, but not required, that a name be provided.

        A suitable name might be the name of the field to which an attribute refers.

        Parameters:
        attributeName - The name for this attribute
        See Also:
        SimpleNullableAttribute()
      • SimpleNullableAttribute

        public SimpleNullableAttribute()
        Creates an attribute with no name. A name for the attribute will be generated automatically from the name of the subclass (or anonymous class) which implements the attribute.
        See Also:
        SimpleNullableAttribute(String)
      • SimpleNullableAttribute

        public SimpleNullableAttribute​(Class<O> objectType,
                                       Class<A> attributeType)
        Creates an attribute with no name, and manually specifies the type of the attribute and its enclosing object.
        Parameters:
        objectType - The type of the object containing this attribute
        attributeType - The type of this attribute
      • SimpleNullableAttribute

        public SimpleNullableAttribute​(Class<O> objectType,
                                       Class<A> attributeType,
                                       String attributeName)
        Creates an attribute with the given name, and manually specifies the type of the attribute and its enclosing object.
        Parameters:
        objectType - The type of the object containing this attribute
        attributeType - The type of this attribute
        attributeName - The name for this attribute
    • Method Detail

      • getValues

        public Iterable<A> getValues​(O object,
                                     QueryOptions queryOptions)
        Returns the values belonging to the attribute in the given object.

        If the attribute is a SimpleAttribute, the list returned will contain a single value for the attribute. If the attribute is a MultiValueAttribute, the list returned will contain any number of values for the attribute.

        Parameters:
        object - The object from which the values of the attribute are required
        queryOptions - Optional parameters supplied by the application along with the operation which is causing this attribute to be invoked (either a query, or an update to the collection)
        Returns:
        The values for the attribute in the given object
      • getValue

        public abstract A getValue​(O object,
                                   QueryOptions queryOptions)
        Returns the (possibly null) value of the attribute from the object.

        Parameters:
        object - The object from which the value of the attribute is required
        queryOptions - Optional parameters supplied by the application along with the operation which is causing this attribute to be invoked (either a query, or an update to the collection)
        Returns:
        The value for the attribute, which can be null