Class StructFlattener.LastMemberNamer

java.lang.Object
nz.org.riskscape.engine.output.StructFlattener.LastMemberNamer
All Implemented Interfaces:
StructFlattener.Namer
Enclosing class:
StructFlattener

public static class StructFlattener.LastMemberNamer extends Object implements StructFlattener.Namer

A StructFlattener.Namer that will use the Struct.StructMember.getKey() from the last segment as the name.

If this name has already been seen then an index is appended. E.g 'name' could become 'name_1'

  • Constructor Details

    • LastMemberNamer

      public LastMemberNamer()
  • Method Details

    • name

      public String name(List<nz.org.riskscape.engine.types.Struct.StructMember> segments)
      Description copied from interface: StructFlattener.Namer

      Get a name for the the given segments.

      Specified by:
      name in interface StructFlattener.Namer
      Parameters:
      segments - segments to provide a name for
      Returns:
      name to be used for the given segments