highsource / highsource/jaxb-tools

New extension for -XObjectsHash

Open
#637 0 comments 0 reactions 0 assignees View on GitHub
enhancement xjc-plugins
Dominant language
Java
Stars
465
Forks
105
PR merge metrics
No merged PRs in 30d

Description

Update the SimpleHash plugin to have a 'mode', or create anew ObjectsHash plugin


1. Use Objects.hash for generating simple, dependency-free, hash codes for generated objects.
2. Include unit test for all-primitive types, including arrays of primitives
3. Include unit test for object containing another generated object as a child object.

```
import java.util.Objects;

public class Employee {
private String name;
private int id;
private double salary;

public Employee(String name, int id, double salary) {
this.name = name;
this.id = id;
this.salary = salary;
}

@Override
public int hashCode() {
return Objects.hash(name, id, salary);
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.