Package org.apache.sis.storage

# Class FeatureQuery.NamedExpression

Object
NamedExpression

All Implemented Interfaces:
  `Serializable`

Enclosing class:
  FeatureQuery

public static class FeatureQuery.NamedExpression extends Object implements Serializable
An expression to be retrieved by a `Query`, together with the name to assign to it. In relational database terminology, subset of columns is called projection. Columns can be given to the `FeatureQuery​.setProjection(NamedExpression[])` method.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final GenericName`
  `alias`
  The name to assign to the expression result, or `null` if unspecified.
  `final Expression<? super AbstractFeature,?>`
  `expression`
  The literal, value reference or more complex expression to be retrieved by a `Query`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NamedExpression(Expression<? super AbstractFeature,?> expression)`
  Creates a new column with the given expression and no name.
  `NamedExpression(Expression<? super AbstractFeature,?> expression, String alias)`
  Creates a new column with the given expression and the given name.
  `NamedExpression(Expression<? super AbstractFeature,?> expression, GenericName alias)`
  Creates a new column with the given expression and the given name.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  Compares this column with the given object for equality.
  `int`
  `hashCode()`
  Returns a hash code value for this column.
  `String`
  `toString()`
  Returns a string representation of this column for debugging purpose.

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### expression

    public final Expression<? super AbstractFeature,?> expression
    The literal, value reference or more complex expression to be retrieved by a `Query`. Never `null`.

  - ### alias

    public final GenericName alias
    The name to assign to the expression result, or `null` if unspecified.

- ## Constructor Details

  - ### NamedExpression

    public NamedExpression(Expression<? super AbstractFeature,?> expression)
    Creates a new column with the given expression and no name.
    Parameters:
      `expression` - the literal, value reference or expression to be retrieved by a `Query`.

  - ### NamedExpression

    public NamedExpression(Expression<? super AbstractFeature,?> expression, GenericName alias)
    Creates a new column with the given expression and the given name.
    Parameters:
      `expression` - the literal, value reference or expression to be retrieved by a `Query`.
      `alias` - the name to assign to the expression result, or `null` if unspecified.

  - ### NamedExpression

    public NamedExpression(Expression<? super AbstractFeature,?> expression, String alias)
    Creates a new column with the given expression and the given name. This constructor creates a `LocalName` from the given string.
    Parameters:
      `expression` - the literal, value reference or expression to be retrieved by a `Query`.
      `alias` - the name to assign to the expression result, or `null` if unspecified.

- ## Method Details

  - ### hashCode

    public int hashCode()
    Returns a hash code value for this column.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      a hash code value.

  - ### equals

    public boolean equals(Object obj)
    Compares this column with the given object for equality.
    Overrides:
      `equals` in class `Object`
    Parameters:
      `obj` - the object to compare with this column.
    Returns:
      whether the two objects are equal.

  - ### toString

    public String toString()
    Returns a string representation of this column for debugging purpose.
    Overrides:
      `toString` in class `Object`
    Returns:
      a string representation of this column.