Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

A Generic Class for Extensions

Đang mở
#708 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu bằng cách xem xét gist được liên kết và so sánh lớp cơ sở được đề xuất, các khóa đã đăng ký, các wither có kiểu và hành vi của equality và hashCode với các phương thức extension hiện có của Java CloudEvents SDK. Kiểm tra xem đề xuất có bao quát các trường hợp sử dụng extension phù hợp của SDK hay không; công việc chỉ được xem là hoàn tất khi đã có một thiết kế được xác định rõ phạm vi và maintainer đồng ý trước khi triển khai.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

[info/enhancement proposal] Here's a quick idea to avoid repetitively writing extensions.

The limitations of this concept, to be safe from many perspectives, are that the supported types are basic, and therefore complex elements must be handled outside of the extension itself.

However, there are several advantages, including having ordered keys, working with inheritance, simplifying extension development, and the ability to type both getters and withers. So at the end, we have a patternization of extension creation.

The following link contains the code to implement this concept: https://gist.github.com/stefanofago73/dd03952e9a2c5f2f113ea064320785d0

Could this be helpful? Could it work, or is it not useful due to other use cases or parts of the library?

The basic design is to have a base class and create Extensions by inheritance. The constructor allows you to register keys, while the extension itself allows you to create typed withers. The Java CloudEvents SDK methods are implemented in the base class, including the hashCode and equality methods. The example code is commented and includes an example of an extension (auth context extension).

Ngôn ngữ chính
Java
Star
446
Fork
172
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cloudevents/sdk-java

Tất cả issue của cloudevents/sdk-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.