code: public JavaFile createPojo(final String name,
                                 final JCTree.JCLiteral literal,
                                 final List<VariableAndValue> usedVariables) throws PackageNameException {
          String eventName;
          String packageName;
          if (name != null) {
              //get event name and package name from qualified name
              final String[] split = name.split("\\.");
              eventName = split[split.length-1];
              checkStringIsValidName(eventName);
              final StringBuffer stringBuffer = new StringBuffer();
              for (int i = 0; i < split.length - 1; i++) {
                  if (i != 0) {
                      stringBuffer.append(".");
                  }
                  stringBuffer.append(split[i]);
                  checkStringIsValidName(split[i]);
              }
              packageName = stringBuffer.toString();
  
              //check that packageName does not contain java keyword
          }
          else {
              eventName = "Event" + hash(literal.getValue().toString());
              packageName = generatedEventsPackage;
          }
  
          final TypeSpec.Builder classBuilder = TypeSpec.classBuilder(eventName)
                  .addModifiers(Modifier.PUBLIC)
                  .superclass(TypeName.get(LoggingEvent.class));
  
          final MethodSpec.Builder constructorBuilder = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC);
  
          addCommonLoggingEventFieldsToConstructor(constructorBuilder);
  
          for (VariableAndValue variableAndValue : usedVariables) {
              addPojoField(classBuilder, constructorBuilder, variableAndValue.getVariable().getName().toString(), TypeName.get(variableAndValue.getVariable().getType()));
          }
  
          final TypeSpec build = classBuilder.addMethod(constructorBuilder.build()).build();
  
          return JavaFile.builder(packageName, build).build();
      }
docs: Create JavaFile representing POJO based on String literal and usedVariables of log statement
  
  @param name    name of POJO to be generated, if null, event is generated based on log literal (hash of it)
  @param literal String literal used in structured log statement
  @param usedVariables list of logging variables used by structured log statement
  @return JavaFile representing Structured log Event (this JavaFile is not yet written, @see POJOService.writeJavaFile)
  @throws PackageNameException when event name is not correct