Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON出力周りのリファクタリング #819

Merged
merged 19 commits into from Mar 22, 2021
Merged

Conversation

ty-v1
Copy link
Contributor

@ty-v1 ty-v1 commented Dec 9, 2020

resolve #511

やったこと

  • カスタムシリアライザのリファクタリング
    下のような1つ1つkeyとvalueを指定している部分を極力消した.

    serializedVariant.addProperty("id", variant.getId());
    serializedVariant.addProperty("generationNumber", generationNumber);
    serializedVariant.addProperty("selectionCount", variant.getSelectionCount());
    serializedVariant.addProperty("fitness", fitness);
    serializedVariant.addProperty("isBuildSuccess", variant.isBuildSucceeded());
    serializedVariant.addProperty("isSyntaxValid", variant.isSyntaxValid());
    serializedVariant.add("bases", context.serialize(variant.getGene()
    .getBases()));
    serializedVariant.add("patch", context.serialize(patch));
    serializedVariant.add("operation", context.serialize(variant.getHistoricalElement()));
    serializedVariant.add("testSummary", context.serialize(variant.getTestResults()));

  • デバッグ用のjsonシリアライザ処理のリファクタリング.Gsonを使うようにした

    /**
    * jsonシリアライザ
    *
    * @return
    */
    @Override
    public String toString() {
    final StringBuilder sb = new StringBuilder();
    sb.append("[\n");
    sb.append(String.join(",\n", this.value.values()
    .stream()
    .map(v -> v.toString(2))
    .collect(Collectors.toList())));
    sb.append("\n");
    sb.append("]\n");
    return sb.toString();
    }

@ty-v1 ty-v1 requested a review from tt-kuma December 9, 2020 07:47
@clione-bot
Copy link

clione-bot bot commented Dec 9, 2020

No problem. Good job!

Copy link
Contributor

@tt-kuma tt-kuma left a comment

Choose a reason for hiding this comment

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

細かい点が多いですがコメント付けました.直接確認した箇所もメモとして残してあります.

@ty-v1
Copy link
Contributor Author

ty-v1 commented Mar 18, 2021

@tt-kuma
修正終わったのでレビューお願いします

@YoshikiHigo
Copy link
Member

このPRのいけてないところをIssueにする.

Copy link
Contributor

@tt-kuma tt-kuma left a comment

Choose a reason for hiding this comment

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

3/18mtgで決定した通り,軽めのレビューをしました.
特に問題はなさそうなのでマージします.
お疲れさまでした.

@tt-kuma tt-kuma merged commit 78d9c2c into master Mar 22, 2021
@tt-kuma tt-kuma deleted the refactor-json-serializers branch March 22, 2021 03:51
SEED0228 added a commit to SEED0228/kGenProg that referenced this pull request Jan 31, 2022
…json-serializers"

This reverts commit 78d9c2c, reversing
changes made to 9540ecd.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Json Export ライブラリの導入
3 participants