test_class.declarator: log
test_class.modifier: private
test_class.original_string: private Log log;
test_class.type: Log
test_class.var_name: log
test_class.declarator: terraformOperation
test_class.modifier: private
test_class.original_string: private TerraformOperation terraformOperation;
test_class.type: TerraformOperation
test_class.var_name: terraformOperation
test_class.declarator: properties
test_class.modifier: private
test_class.original_string: private Properties properties;
test_class.type: Properties
test_class.var_name: properties
test_class.file: tf-build-tools/tf-maven-plugin/src/test/java/com/deliveredtechnologies/maven/terraform/mojo/TerraformMojoTest.java
test_class.identifier: TerraformMojoTest
test_case.body: @Test
    public void getFieldAsPropertiesGetsOnlyTheSetSubclassFieldsAsProperties() throws MojoExecutionException {
      TerraformMojoStub terraformMojoStub = new TerraformMojoStub();
      terraformMojoStub.boolProp = true;
      terraformMojoStub.intProp = 22;
      terraformMojoStub.longProp = 1000;
      terraformMojoStub.stringProp = "Hello";
  
      properties = terraformMojoStub.getFieldsAsProperties();
  
      Assert.assertEquals(properties.size(), 5);
      Assert.assertEquals(properties.get("boolProp"), true);
      Assert.assertEquals(properties.get("intProp"), 22);
      Assert.assertEquals(properties.get("longProp"), 1000L);
      Assert.assertEquals(properties.get("stringProp"), "Hello");
  
      terraformMojoStub.boolProp = false;
      terraformMojoStub.intProp = 0;
      terraformMojoStub.longProp = 0;
  
      properties = terraformMojoStub.getFieldsAsProperties();
  
      Assert.assertEquals(properties.size(), 2);
      Assert.assertEquals(properties.get("stringProp"), "Hello");
    }
test_case.class_method_signature: TerraformMojoTest.getFieldAsPropertiesGetsOnlyTheSetSubclassFieldsAsProperties()
test_case.full_signature: @Test public void getFieldAsPropertiesGetsOnlyTheSetSubclassFieldsAsProperties()
test_case.identifier: getFieldAsPropertiesGetsOnlyTheSetSubclassFieldsAsProperties
test_case.invocations: getFieldsAsProperties assertEquals size assertEquals get assertEquals get assertEquals get assertEquals get getFieldsAsProperties assertEquals size assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getFieldAsPropertiesGetsOnlyTheSetSubclassFieldsAsProperties()
focal_class.file: tf-build-tools/tf-maven-plugin/src/main/java/com/deliveredtechnologies/maven/terraform/mojo/TerraformMojo.java
focal_class.identifier: TerraformMojo
focal_class.class_method_signature: TerraformMojo.execute(TerraformOperation<T> tfOperation, Properties properties)
focal_class.full_signature: protected final void execute(TerraformOperation<T> tfOperation, Properties properties)
focal_class.identifier: execute
focal_class.modifiers: protected final
focal_class.parameters: (TerraformOperation<T> tfOperation, Properties properties)
focal_class.return: void
focal_class.signature: void execute(TerraformOperation<T> tfOperation, Properties properties)
focal_class.class_method_signature: TerraformMojo.execute(TerraformOperation<T> tfOperation)
focal_class.full_signature: protected final void execute(TerraformOperation<T> tfOperation)
focal_class.identifier: execute
focal_class.modifiers: protected final
focal_class.parameters: (TerraformOperation<T> tfOperation)
focal_class.return: void
focal_class.signature: void execute(TerraformOperation<T> tfOperation)
focal_class.class_method_signature: TerraformMojo.getFieldsAsProperties()
focal_class.full_signature: protected final Properties getFieldsAsProperties()
focal_class.identifier: getFieldsAsProperties
focal_class.modifiers: protected final
focal_class.parameters: ()
focal_class.return: Properties
focal_class.signature: Properties getFieldsAsProperties()
focal_class.class_method_signature: TerraformMojo.getTFvars(Object value)
focal_class.full_signature: private Object getTFvars(Object value)
focal_class.identifier: getTFvars
focal_class.modifiers: private
focal_class.parameters: (Object value)
focal_class.return: Object
focal_class.signature: Object getTFvars(Object value)
focal_class.superclass: extends AbstractMojo
focal_method.body: protected final Properties getFieldsAsProperties() throws MojoExecutionException {
      Class clazz = this.getClass();
      List<Field> fieldList = Arrays.stream(clazz.getDeclaredFields())
          .collect(Collectors.toList());
      Properties properties = new Properties();
  
      for (Field field : fieldList) {
        try {
          field.setAccessible(true);
          Object fieldVal = field.get(this);
          if (fieldVal == null
              || (fieldVal.equals(false) && !field.getName().startsWith("refresh"))
              || (Number.class.isAssignableFrom(fieldVal.getClass()) && ((Number)fieldVal).longValue() <= 0)) {
            continue;
          }
          if (field.getName().equalsIgnoreCase("tfvars")) {
            fieldVal = getTFvars(fieldVal);
          }
          properties.put(field.getName(), fieldVal);
        } catch (NullPointerException npe) {
          //the field is null; just move along
        } catch (IllegalAccessException iae) {
          throw new MojoExecutionException("Unable to access " + field.getName() + " from Mojo!", iae);
        } catch (JsonProcessingException jpe) {
          throw new MojoExecutionException("Unable to convert " + field.getName() + " to json", jpe);
        }
      }
      return properties;
    }
focal_method.class_method_signature: TerraformMojo.getFieldsAsProperties()
focal_method.full_signature: protected final Properties getFieldsAsProperties()
focal_method.identifier: getFieldsAsProperties
focal_method.invocations: getClass collect stream getDeclaredFields toList setAccessible get equals startsWith getName isAssignableFrom getClass longValue equalsIgnoreCase getName getTFvars put getName getName getName
focal_method.modifiers: protected final
focal_method.parameters: ()
focal_method.return: Properties
focal_method.signature: Properties getFieldsAsProperties()