Class FlattenProjection

java.lang.Object
nz.org.riskscape.engine.projection.FlattenProjection
All Implemented Interfaces:
nz.org.riskscape.engine.projection.Projection

public class FlattenProjection extends Object implements nz.org.riskscape.engine.projection.Projection

Projects tuples where nested tuples are flattened in to a new attribute, according to a specific join character, e.g:

{a: {b: Text, c: Text}, {d: {e: Integer}}} -> {a.b: Text, a.c: Text, d.e: Integer}

  • Field Summary

    Fields inherited from interface nz.org.riskscape.engine.projection.Projection

    IDENTITY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    flattenVisitStruct(List<List<nz.org.riskscape.engine.types.Struct.StructMember>> expressions, nz.org.riskscape.engine.types.Struct.StructBuilder copyTo, nz.org.riskscape.engine.types.Struct struct, List<nz.org.riskscape.engine.types.Struct.StructMember> stack, String joinWith, boolean nullable)
     
    nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.projection.Projector>
    getProjectionFunction(nz.org.riskscape.engine.types.Struct sourceType)
     
    nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.types.Struct>
    projectType(nz.org.riskscape.engine.types.Struct source)
     
    protected nz.org.riskscape.engine.projection.FlattenProjection.StructFlattener
    structFlattener(nz.org.riskscape.engine.types.Struct source)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FlattenProjection

      public FlattenProjection(String joinWith)
  • Method Details

    • projectType

      public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.types.Struct> projectType(nz.org.riskscape.engine.types.Struct source)
      Specified by:
      projectType in interface nz.org.riskscape.engine.projection.Projection
    • getProjectionFunction

      public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.projection.Projector> getProjectionFunction(nz.org.riskscape.engine.types.Struct sourceType)
      Specified by:
      getProjectionFunction in interface nz.org.riskscape.engine.projection.Projection
    • structFlattener

      protected nz.org.riskscape.engine.projection.FlattenProjection.StructFlattener structFlattener(nz.org.riskscape.engine.types.Struct source)
    • flattenVisitStruct

      protected void flattenVisitStruct(List<List<nz.org.riskscape.engine.types.Struct.StructMember>> expressions, nz.org.riskscape.engine.types.Struct.StructBuilder copyTo, nz.org.riskscape.engine.types.Struct struct, List<nz.org.riskscape.engine.types.Struct.StructMember> stack, String joinWith, boolean nullable)