[Java] object deep copy into different type
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
ソースファイル、テスト、またはエントリーポイントは指定されていません。まず現在のオブジェクトのディープコピー機構を追跡し、意図されている API と設計上の制約について discussions/1973 と pull/1974 を確認してください。異なる型間の直接的なディープコピーをサポートし、例にある一致するフィールドを保持し、シリアライゼーションバッファを経由する往復を行わないことが完了の条件です。
索引モデルが issue の本文から書いたものです。
説明
Feature Request
We've supported object deep copy of object from one instance to another instance, but we still don't support deep copy object from one type into another type.
Is your feature request related to a problem? Please describe
deep copy object from one type into another type:
class Struct1 {
int f1;
String f2;
public Struct1(int f1, String f2) {
this.f1 = f1;
this.f2 = f2;
}
}
class Struct2 {
int f1;
String f2;
double f3;
}
Struct1 s1 = xxx;
Struct2 struct2 = copyTo(s1, Struct2.class)
Describe the solution you'd like
Extend the current object deep copy mechanism
Describe alternatives you've considered
Mock by:
public class StructMappingExample {
static class Struct1 {
int f1;
String f2;
public Struct1(int f1, String f2) {
this.f1 = f1;
this.f2 = f2;
}
}
static class Struct2 {
int f1;
String f2;
double f3;
}
static ThreadSafeFury fury1 = Fury.builder()
.withCompatibleMode(CompatibleMode.COMPATIBLE).buildThreadSafeFury();
static ThreadSafeFury fury2 = Fury.builder()
.withCompatibleMode(CompatibleMode.COMPATIBLE).buildThreadSafeFury();
static {
fury1.register(Struct1.class);
fury2.register(Struct2.class);
}
public static void main(String[] args) {
Struct1 struct1 = new Struct1(10, "abc");
Struct2 struct2 = (Struct2) fury2.deserialize(fury1.serialize(struct1));
Assert.assertEquals(struct2.f1, struct1.f1);
Assert.assertEquals(struct2.f2, struct1.f2);
struct1 = (Struct1) fury1.deserialize(fury2.serialize(struct2));
Assert.assertEquals(struct1.f1, struct2.f1);
Assert.assertEquals(struct1.f2, struct2.f2);
}
}
This will work, but not that efficient cause it will write/read buffer.
Additional context
https://github.com/apache/fury/discussions/1973
https://github.com/apache/fury/pull/1974
- 主要言語
- Java
- スター
- 4.6k
- フォーク
- 470
- 平均マージ
- 9時間 28分
- マージ済み PR(30日)
- 33
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/fory のほかの issue
-
[Python] Compatible xlang read silently drops fields when the peer writes camelCase/PascalCase namesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
[Build] Add ASF license headers to config files that allow comments再び着手できるかも @Swatantra-66 が 28 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
xlang: the snake_case conversion of field names is not specified, and the runtimes do not agree再び着手できるかも @dhruv-dagar が 15 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
[Rust] Add an option to use Rust native enum対応中かも @BaldDemian が 19 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
apache/fory#4177 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Untyped read collapses a number literal that does not fit a double対応中かも @mohitjoshi-hey が 21 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
apache/fory#4170 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
wildfly/wildfly-channel#446 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
5.0.x backport enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
spring-cloud/spring-cloud-function#1507 ·
メンテナーはふだん 1 日以内に返信
-
Empty blood pressure handled as “null” string in exam edit対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
open-learning-exchange/myplanet#18484 ·
メンテナーはふだん 1 日以内に返信
-
ELProcessor.defineFunction() fails for valid method signatures対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
jakartaee/expression-language#492 ·