Class AttributeGeneratorWrapper


public class AttributeGeneratorWrapper extends GeneratorWrapper<AttributeGeneratorProcessor>
Wrapper class for the AttributeGeneratorProcessor. This class is responsible for managing the attribute generation process. It provides methods to generate attributes and calculate match scores.
  • Constructor Details

    • AttributeGeneratorWrapper

      public AttributeGeneratorWrapper(ProcessorFactory processorFactory, AttributeGeneratorProcessor processor, Map<String,Object> parameters)
      Constructs a new AttributeGeneratorWrapper with the specified processor factory, processor, and parameters.
      Parameters:
      processorFactory - the processor factory to use
      processor - the attribute generator processor
      parameters - the parameters to set in the processor
  • Method Details

    • generateAttribute

      public Object generateAttribute(EntityInstance entityInstance, FieldDefinition fieldDefinition)
      Generates an attribute for the given entity instance. This method can be overridden by the generator script. The generateAttribute() function is called multiple times to generate a new value and must return this value. For example, it can be used to return a random value from a mapping table set up in the init() function.
      Parameters:
      entityInstance - the entity instance for which to generate the attribute
      fieldDefinition - the field definition of the attribute to generate
      Returns:
      the generated attribute
    • getMatchScore

      public int getMatchScore(FieldDefinition attribute, EntityGeneratorDefinition entityGeneratorDefinition, Map<String,Object> parameters)
      Calculates the match score for the given attribute and entity generator definition. This method is used to determine how well the generated attribute matches the expected value. The higher the score, the better the match. This method can be overridden by the generator script.
      Parameters:
      attribute - the attribute definition
      entityGeneratorDefinition - the entity generator definition
      parameters - the parameters to use for calculating the match score
      Returns:
      the match score