Skip to content

Conversation

tcheeric
Copy link
Owner

Summary

  • make EventFactory and GenericEventFactory generic
  • use typed GenericEventFactory in NIP01
  • add unit tests for the new generic methods
  • run mvn -q verify

Testing

  • mvn -q verify

https://chatgpt.com/codex/tasks/task_b_688a863639c48331803c6366cc2bd9d6

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds generic type support to the event factory classes to improve type safety when working with different tag types. The changes eliminate the need for unsafe type casting and provide better compile-time type checking.

  • Makes EventFactory and GenericEventFactory generic with type parameters for event and tag types
  • Updates NIP01 class to use typed GenericEventFactory instances instead of unsafe casting
  • Adds unit tests to verify the new generic functionality works correctly

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
EventFactory.java Adds generic type parameters <E extends GenericEvent, T extends BaseTag> to the abstract base class
GenericEventFactory.java Implements generic type parameter <T extends BaseTag> and updates constructor/method signatures
NIP01.java Replaces unsafe type casting with properly typed GenericEventFactory instances
NIP01Test.java Adds unit tests for the new generic methods with recipient lists and tag lists

@tcheeric tcheeric merged commit 095d637 into develop Jul 30, 2025
@tcheeric tcheeric deleted the codex/add-generics-to-factories-and-refactor-methods branch July 30, 2025 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant