Interface Projector
- All Superinterfaces:
AutoCloseable,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 Summary
Modifier and TypeMethodDescriptiondefault Map<List<Struct.StructMember>,List<Struct.StructMember>> default StructDeprecated.use getProducedTypeThe exactStructobject that is expected to be seen by theFunction.apply(java.lang.Object)default Optional<Function<SpatialMetadata,SpatialMetadata>> An optional function used for transforming spatial metadata from source to target.static ProjectorReturns a 'noop' projector that does nothing other than pass the tuple along as-isstatic Map<List<Struct.StructMember>,List<Struct.StructMember>> identityMapping(Struct struct) static Stringjoin(List<Struct.StructMember> members)
-
Method Details
-
identity
Returns a 'noop' projector that does nothing other than pass the tuple along as-is
- Parameters:
type- the type of tuple that comes in and out
-
join
-
identityMapping
-
getProducedType
Struct getProducedType()- Specified by:
getProducedTypein interfaceRealized
-
getProjectedType
Deprecated.use getProducedType -
getSourceType
Struct getSourceType()The exact
Structobject that is expected to be seen by theFunction.apply(java.lang.Object) -
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
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
- Returns:
- a human-readable version of
getDirectMapping(), useful for debug statements, test assertions etc
-