Interface Projector

All Superinterfaces:
AutoCloseable, Function<Tuple,Tuple>, Realized

public interface Projector extends Function<Tuple,Tuple>, Realized

Realized Projection of one Struct to another. Exists so that a Projection's projection function can be associated with other metadata, such as the source and target Struct and a possible mapping of attributes from one to the other.

  • Method Details

    • join

      static String join(List<Struct.StructMember> members)
    • identityMapping

      static Map<List<Struct.StructMember>,List<Struct.StructMember>> identityMapping(Struct struct)
    • getProjectedType

      Struct getProjectedType()

      The exact Struct object that will be assigned to Tuples that emerge from this Projector

    • getSourceType

      Struct getSourceType()

      The exact Struct object that is expected to be seen by the Function.apply(java.lang.Object)

    • getDirectMapping

      default Map<List<Struct.StructMember>,List<Struct.StructMember>> getDirectMapping()
      Returns:
      a map that can be used to trace attributes from the target type (the key set) back to their source type (value set). Optional, as this is here to allow various optimisations to be applied to queries. Not implementing this method will prevent various optimisations for being possible.
    • getSpatialMetadataMapper

      default Optional<Function<SpatialMetadata,SpatialMetadata>> getSpatialMetadataMapper()

      An optional function used for transforming spatial metadata from source to target. If left out, spatial metadata is lost during projection. A default, fairly sane implementation exists that copies the CRS and picks the single geometry member that was found at the top level of the projectors projected type.

    • getDirectMappingStrings

      default Map<String,String> getDirectMappingStrings()
      Returns:
      a human-readable version of getDirectMapping(), useful for debug statements, test assertions etc