Repository: asyncapi/modelina (ts)

Issue:
Wrong property name in JavaCommonPresetOptions
#### Describe the bug
`JavaCommonPresetOptions` interface in `src/generators/java/presets/CommonPreset.ts` defines:
```typescript
export interface JavaCommonPresetOptions {
  equal: boolean;
  hash: boolean;
  classToString: boolean;
}
```
see `hash`

but the actual code expects: `options.hashCode`
```typescript
const shouldContainHashCode = options.hashCode === undefined || options.hashCode === true;
```
https://github.com/asyncapi/modelina/blame/master/src/generators/java/presets/CommonPreset.ts#L7
https://github.com/asyncapi/modelina/blame/master/src/generators/java/presets/CommonPreset.ts#L111

#### How to Reproduce
I found this when trying to generalize creation of JavaGenerator by creating a factory method for it. When I tried to use the example with this interface it obviously failed as (working) example states:
```typescript
    {
      preset: JAVA_COMMON_PRESET,
      options: {
        hashCode: true,
        classToString: true,
      }
    }
```

#### Expected behavior
The options interface should match the actual options of the preset or it shouldn't be exported at all. From simple github search the interface is not used anywhere.

Extra note: maybe it would be nicer to also change `equal` -> `equals` as the generated method is `equals` not `equal` but that would be breaking change.

---

If the fix will be just changing the name of the property I could provide the simple PR. 
/my first issue for this project so I didn't start with a PR and from what I see it probably won't be last but im happy to help :)/

Pull request:
fix: wrong property name in JavaCommonPresetOptions interface (#544)
**Description**
Changed wrong `hash` property in `JavaCommonPresetOptions` to `hashCode` as that the value that is actually used.

**Related issue(s)**
Fixes #544 

Patch:
diff --git a/src/generators/java/presets/CommonPreset.ts b/src/generators/java/presets/CommonPreset.ts
index cca41449..79559892 100644
--- a/src/generators/java/presets/CommonPreset.ts
+++ b/src/generators/java/presets/CommonPreset.ts
@@ -6,7 +6,7 @@ import { CommonModel } from '../../../models';
 
 export interface JavaCommonPresetOptions {
   equal: boolean;
-  hash: boolean;
+  hashCode: boolean;
   classToString: boolean;
 }
 


Test patch:
diff --git a/test/generators/java/presets/CommonPreset.spec.ts b/test/generators/java/presets/CommonPreset.spec.ts
index a27bda35..62529a49 100644
--- a/test/generators/java/presets/CommonPreset.spec.ts
+++ b/test/generators/java/presets/CommonPreset.spec.ts
@@ -1,4 +1,4 @@
-import { JavaGenerator, JAVA_COMMON_PRESET } from '../../../../src/generators'; 
+import {JavaGenerator, JAVA_COMMON_PRESET, JavaCommonPresetOptions} from '../../../../src/generators';
 
 describe('JAVA_COMMON_PRESET', () => {
   const doc = {
@@ -50,6 +50,27 @@ describe('JAVA_COMMON_PRESET', () => {
       expect(classModel.result).toMatchSnapshot();
       expect(classModel.dependencies.includes('import java.util.Objects;')).toEqual(true);
     });
+    test('should not render any functions when all 3 options are disabled', async () => {
+      const options: JavaCommonPresetOptions = {
+        equal: false,
+        hashCode: false,
+        classToString: false,
+      };
+
+      const generator = new JavaGenerator(
+        {
+          presets: [{
+            preset: JAVA_COMMON_PRESET,
+            options
+          }]
+        }
+      );
+      const inputModel = await generator.process(doc);
+      const model = inputModel.models['Clazz'];
+
+      const classModel = await generator.renderClass(model, inputModel);
+      expect(classModel.result).toMatchSnapshot();
+    });
     test('should render equals', async () => {
       const generator = new JavaGenerator(
         { 
diff --git a/test/generators/java/presets/__snapshots__/CommonPreset.spec.ts.snap b/test/generators/java/presets/__snapshots__/CommonPreset.spec.ts.snap
index 345da494..5a057d12 100644
--- a/test/generators/java/presets/__snapshots__/CommonPreset.spec.ts.snap
+++ b/test/generators/java/presets/__snapshots__/CommonPreset.spec.ts.snap
@@ -219,6 +219,36 @@ exports[`JAVA_COMMON_PRESET with option should render all functions 1`] = `
 }"
 `;
 
+
+exports[`JAVA_COMMON_PRESET with option should not render any functions when all 3 options are disabled 1`] = `
+"public class Clazz {
+  private Boolean requiredProp;
+  private String stringProp;
+  private Double numberProp;
+  private Boolean booleanProp;
+  private String[] arrayProp;
+  private Map<String, Object> additionalProperties;
+
+  public Boolean getRequiredProp() { return this.requiredProp; }
+  public void setRequiredProp(Boolean requiredProp) { this.requiredProp = requiredProp; }
+
+  public String getStringProp() { return this.stringProp; }
+  public void setStringProp(String stringProp) { this.stringProp = stringProp; }
+
+  public Double getNumberProp() { return this.numberProp; }
+  public void setNumberProp(Double numberProp) { this.numberProp = numberProp; }
+
+  public Boolean getBooleanProp() { return this.booleanProp; }
+  public void setBooleanProp(Boolean booleanProp) { this.booleanProp = booleanProp; }
+
+  public String[] getArrayProp() { return this.arrayProp; }
+  public void setArrayProp(String[] arrayProp) { this.arrayProp = arrayProp; }
+
+  public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; }
+  public void setAdditionalProperties(Map<String, Object> additionalProperties) { this.additionalProperties = additionalProperties; }
+}"
+`;
+
 exports[`JAVA_COMMON_PRESET with option should render classToString 1`] = `
 "public class Clazz {
   private Boolean requiredProp;