Skip to content

Conversation

@rishi-aga
Copy link
Collaborator

Resolves #1892

Description

Fix Build warnings for elide-model-config

How Has This Been Tested?

Existing tests pass.

License

I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@rishi-aga rishi-aga force-pushed the fixModelConfigBuildWarnings branch from b72df48 to 6c64ecb Compare March 29, 2021 13:39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we replacing Singular?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rishi-aga rishi-aga force-pushed the fixModelConfigBuildWarnings branch from 60cf86f to 323d96a Compare March 30, 2021 23:13
@rishi-aga rishi-aga requested a review from wcekan March 30, 2021 23:15
aklish
aklish previously approved these changes Mar 31, 2021

@JsonProperty("isFact")
private Boolean isFact = true;
private Boolean isFact;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aklish are this fields purposely modifiable after building? Or should they all be final?

Suggested change
private Boolean isFact;
private final Boolean isFact;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we cannot declare all fields final, because we have inheritance logic

"dbConnectionName",
"filterTemplate"
})
@Data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use builder for Jackson deserializer

Suggested change
@Data
@JsonDeserialize(builder = Table.TableBuilder.class)
@Data

Copy link
Contributor

@wcekan wcekan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor builders using JsonDeserialize and remove no arg constructors.

Comment on lines +57 to +60
public Argument() {
this.values = new LinkedHashSet<>();
}

Copy link
Contributor

@wcekan wcekan Mar 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove and replace with JsonDeserialize builder.

Suggested change
public Argument() {
this.values = new LinkedHashSet<>();
}

"tableSource",
"default"
})
@Data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@Data
@JsonDeserialize(builder = Argument.ArgumentBuilder.class)
@Data

@JsonProperty("values")
@JsonDeserialize(as = LinkedHashSet.class)
private Set<String> values = new LinkedHashSet<>();
private Set<String> values;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private Set<String> values;
private final Set<String> values;

Comment on lines +96 to +104
public Dimension() {
this.hidden = false;
this.readAccess = "Prefab.Role.All";
this.grains = new ArrayList<>();
this.tags = new LinkedHashSet<>();
this.values = new LinkedHashSet<>();
this.arguments = new ArrayList<>();
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public Dimension() {
this.hidden = false;
this.readAccess = "Prefab.Role.All";
this.grains = new ArrayList<>();
this.tags = new LinkedHashSet<>();
this.values = new LinkedHashSet<>();
this.arguments = new ArrayList<>();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix elide-model-config build warnings

4 participants