class SimpleViolation implements Violation {

    public static SimpleViolation fromJson(final JsonObject jsonViolation) {
        String vSeverity = jsonViolation.getString(ApiConstants.violationKeys().severity(), Severity.MINOR.name());
        Severity severity = Severity.valueOf(vSeverity);
        String description = jsonViolation.getString(ApiConstants.violationKeys().description(), "");
        List<PackageId> packages = optArray(jsonViolation, ApiConstants.violationKeys().packages())
                .map(array -> mapArrayOfStrings(array, PackageId::fromString, true))
                .orElseGet(Collections::emptyList);

        return new SimpleViolation(severity, description, packages);
    }

    public  SimpleViolation(final Severity severity, final String description, final PackageId... packages);
    public  SimpleViolation(final Severity severity, final String description, final List<PackageId> packages);

}