test_class.file: api/src/test/java/net/adamcin/oakpal/api/SimpleViolationTest.java
test_class.identifier: SimpleViolationTest
test_case.body: @Test
      public void testFromJson() {
          final Severity severity = Severity.MINOR;
          final PackageId packId = PackageId.fromString("my_pack");
          final String description = "some description";
          final Violation violation = new Violation() {
              @Override
              public Severity getSeverity() {
                  return severity;
              }
  
              @Override
              public Collection<PackageId> getPackages() {
                  return Collections.singletonList(packId);
              }
  
              @Override
              public String getDescription() {
                  return description;
              }
          };
  
          final JsonObject json = violation.toJson();
  
          final SimpleViolation simpleViolation = SimpleViolation.fromJson(json);
          assertSame("expect same severity", severity, simpleViolation.getSeverity());
          assertEquals("expect equal packageIds", Collections.singletonList(packId),
                  simpleViolation.getPackages());
          assertEquals("expect equal description", description, simpleViolation.getDescription());
      }
test_case.class_method_signature: SimpleViolationTest.testFromJson()
test_case.full_signature: @Test public void testFromJson()
test_case.identifier: testFromJson
test_case.invocations: fromString singletonList toJson fromJson assertSame getSeverity assertEquals singletonList getPackages assertEquals getDescription
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFromJson()
focal_class.declarator: severity
focal_class.modifier: private final
focal_class.original_string: private final Severity severity;
focal_class.type: Severity
focal_class.var_name: severity
focal_class.declarator: description
focal_class.modifier: private final
focal_class.original_string: private final String description;
focal_class.type: String
focal_class.var_name: description
focal_class.declarator: packages
focal_class.modifier: private final
focal_class.original_string: private final List<PackageId> packages;
focal_class.type: List<PackageId>
focal_class.var_name: packages
focal_class.file: api/src/main/java/net/adamcin/oakpal/api/SimpleViolation.java
focal_class.identifier: SimpleViolation
focal_class.interfaces: implements Violation
focal_class.class_method_signature: SimpleViolation.SimpleViolation(final Severity severity, final String description, final PackageId... packages)
focal_class.full_signature: public  SimpleViolation(final Severity severity, final String description, final PackageId... packages)
focal_class.identifier: SimpleViolation
focal_class.modifiers: public
focal_class.parameters: (final Severity severity, final String description, final PackageId... packages)
focal_class.signature:  SimpleViolation(final Severity severity, final String description, final PackageId... packages)
focal_class.class_method_signature: SimpleViolation.SimpleViolation(final Severity severity, final String description, final List<PackageId> packages)
focal_class.full_signature: public  SimpleViolation(final Severity severity, final String description, final List<PackageId> packages)
focal_class.identifier: SimpleViolation
focal_class.modifiers: public
focal_class.parameters: (final Severity severity, final String description, final List<PackageId> packages)
focal_class.signature:  SimpleViolation(final Severity severity, final String description, final List<PackageId> packages)
focal_class.class_method_signature: SimpleViolation.builder()
focal_class.full_signature: public static Builder builder()
focal_class.identifier: builder
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Builder
focal_class.signature: Builder builder()
focal_class.class_method_signature: SimpleViolation.builder(final ResourceBundle resourceBundle)
focal_class.full_signature: public static Builder builder(final ResourceBundle resourceBundle)
focal_class.identifier: builder
focal_class.modifiers: public static
focal_class.parameters: (final ResourceBundle resourceBundle)
focal_class.return: Builder
focal_class.signature: Builder builder(final ResourceBundle resourceBundle)
focal_class.class_method_signature: SimpleViolation.getSeverity()
focal_class.full_signature: @Override public Severity getSeverity()
focal_class.identifier: getSeverity
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Severity
focal_class.signature: Severity getSeverity()
focal_class.class_method_signature: SimpleViolation.getPackages()
focal_class.full_signature: @Override public Collection<PackageId> getPackages()
focal_class.identifier: getPackages
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<PackageId>
focal_class.signature: Collection<PackageId> getPackages()
focal_class.class_method_signature: SimpleViolation.getDescription()
focal_class.full_signature: @Override public String getDescription()
focal_class.identifier: getDescription
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDescription()
focal_class.class_method_signature: SimpleViolation.fromReported(final Violation violation)
focal_class.full_signature: public static SimpleViolation fromReported(final Violation violation)
focal_class.identifier: fromReported
focal_class.modifiers: public static
focal_class.parameters: (final Violation violation)
focal_class.return: SimpleViolation
focal_class.signature: SimpleViolation fromReported(final Violation violation)
focal_class.class_method_signature: SimpleViolation.fromJson(final JsonObject jsonViolation)
focal_class.full_signature: public static SimpleViolation fromJson(final JsonObject jsonViolation)
focal_class.identifier: fromJson
focal_class.modifiers: public static
focal_class.parameters: (final JsonObject jsonViolation)
focal_class.return: SimpleViolation
focal_class.signature: SimpleViolation fromJson(final JsonObject jsonViolation)
focal_class.class_method_signature: SimpleViolation.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: SimpleViolation.equals(final Object o)
focal_class.full_signature: @Override public boolean equals(final Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (final Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(final Object o)
focal_class.class_method_signature: SimpleViolation.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_method.body: 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);
      }
focal_method.class_method_signature: SimpleViolation.fromJson(final JsonObject jsonViolation)
focal_method.full_signature: public static SimpleViolation fromJson(final JsonObject jsonViolation)
focal_method.identifier: fromJson
focal_method.invocations: getString severity violationKeys name valueOf getString description violationKeys orElseGet map optArray packages violationKeys mapArrayOfStrings
focal_method.modifiers: public static
focal_method.parameters: (final JsonObject jsonViolation)
focal_method.return: SimpleViolation
focal_method.signature: SimpleViolation fromJson(final JsonObject jsonViolation)