diff --git a/.config/checkstyle/checkstyle.xml b/.config/checkstyle/checkstyle.xml
index 463a629a..b5858800 100644
--- a/.config/checkstyle/checkstyle.xml
+++ b/.config/checkstyle/checkstyle.xml
@@ -79,11 +79,15 @@
+
+
+
+
+
+
-
-
-
+
@@ -140,6 +144,8 @@
+
+
diff --git a/.config/pmd/java/ruleset.xml b/.config/pmd/java/ruleset.xml
index e96576b1..8dde42bc 100644
--- a/.config/pmd/java/ruleset.xml
+++ b/.config/pmd/java/ruleset.xml
@@ -13,6 +13,7 @@
+
@@ -45,8 +46,10 @@
+
+
@@ -138,6 +141,7 @@
+
@@ -146,7 +150,6 @@
-
@@ -155,6 +158,7 @@
+
@@ -164,6 +168,7 @@
+
@@ -208,6 +213,36 @@
+
+
+`Optional#get` can be interpreted as a getter by developers, however this is not the case as it throws an exception when empty.
+
+It should be replaced by
+* doing a mapping directly using `.map` or `.ifPresent`
+* using the preferred `.orElseThrow`, `.orElse` or `.or` methods
+
+Java Developer Brian Goetz also writes regarding this topic:
+
+> Java 8 was a huge improvement to the platform, but one of the few mistakes we made was the naming of `Optional.get()`, because the name just invites people to call it without calling `isPresent()`, undermining the whole point of using `Optional` in the first place.
+>
+> During the Java 9 time frame, we proposed to deprecate `Optional.get()`, but the public response to that was ... let's say cold. As a smaller step, we introduced `orElseThrow()` in 10 (see [JDK-8140281](https://bugs.openjdk.java.net/browse/JDK-8140281)) as a more transparently named synonym for the current pernicious behavior of `get()`. IDEs warn on unconditional use of `get()`, but not on `orElseThrow()`, which is a step forward in teaching people to code better. The question is, in a sense, a "glass half empty" view of the current situation; `get()` is still problematic.
+
+ 3
+
+
+
+
+
+
+
+
+
@@ -410,7 +446,7 @@ A `Set` also prevents duplicates when the ORM reads multiple identical rows from
diff --git a/.config/topo/upstream.yml b/.config/topo/upstream.yml
new file mode 100644
index 00000000..6e0fe078
--- /dev/null
+++ b/.config/topo/upstream.yml
@@ -0,0 +1,2 @@
+- url: https://github.com/xdev-software/openapi-client-maven-template.git
+ branch: master
diff --git a/.github/.lycheeignore b/.github/.lycheeignore
index dc88a070..217b0ae4 100644
--- a/.github/.lycheeignore
+++ b/.github/.lycheeignore
@@ -1,3 +1,4 @@
# Ignorefile for broken link check
localhost
mvnrepository.com
+stackoverflow.com
diff --git a/.github/workflows/broken-links.yml b/.github/workflows/broken-links.yml
index 2675c8b6..8aeed096 100644
--- a/.github/workflows/broken-links.yml
+++ b/.github/workflows/broken-links.yml
@@ -3,7 +3,7 @@ name: Broken links
on:
workflow_dispatch:
schedule:
- - cron: "23 23 * * 0"
+ - cron: "23 5 * * 0"
permissions:
issues: write
@@ -13,14 +13,15 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
- run: mv .github/.lycheeignore .lycheeignore
- name: Link Checker
id: lychee
- uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2
+ uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2
with:
+ args: "--verbose --no-progress './**/*.md'"
fail: false # Don't fail on broken links, create an issue instead
- name: Find already existing issue
diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml
index b1a6d66f..0cd2d9b7 100644
--- a/.github/workflows/check-build.yml
+++ b/.github/workflows/check-build.yml
@@ -31,7 +31,7 @@ jobs:
java: [17, 21, 25]
distribution: [temurin]
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
- name: Set up JDK
uses: actions/setup-java@v5
@@ -40,7 +40,7 @@ jobs:
java-version: ${{ matrix.java }}
- name: Cache Maven
- uses: actions/cache@v5
+ uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
@@ -69,7 +69,7 @@ jobs:
fi
- name: Upload demo files
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
name: demo-files-java-${{ matrix.java }}
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
@@ -84,7 +84,7 @@ jobs:
java: [21]
distribution: [temurin]
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
- name: Set up JDK
uses: actions/setup-java@v5
@@ -93,7 +93,7 @@ jobs:
java-version: ${{ matrix.java }}
- name: Cache Maven
- uses: actions/cache@v5
+ uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }}
@@ -101,7 +101,7 @@ jobs:
${{ runner.os }}-mvn-checkstyle-
- name: CheckStyle Cache
- uses: actions/cache@v5
+ uses: actions/cache@v6
with:
path: '**/target/checkstyle-cachefile'
key: ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }}
@@ -120,7 +120,7 @@ jobs:
java: [17]
distribution: [temurin]
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
- name: Set up JDK
uses: actions/setup-java@v5
@@ -129,7 +129,7 @@ jobs:
java-version: ${{ matrix.java }}
- name: Cache Maven
- uses: actions/cache@v5
+ uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }}
@@ -137,7 +137,7 @@ jobs:
${{ runner.os }}-mvn-pmd-
- name: PMD Cache
- uses: actions/cache@v5
+ uses: actions/cache@v6
with:
path: '**/target/pmd/pmd.cache'
key: ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }}
@@ -151,8 +151,8 @@ jobs:
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C
- name: Upload report
- if: always()
- uses: actions/upload-artifact@v6
+ if: ${{ !cancelled() }}
+ uses: actions/upload-artifact@v7
with:
name: pmd-report
if-no-files-found: ignore
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 3f55399a..6133d1a6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
- name: Set up JDK
uses: actions/setup-java@v5
@@ -28,7 +28,7 @@ jobs:
# Try to reuse existing cache from check-build
- name: Try restore Maven Cache
- uses: actions/cache/restore@v5
+ uses: actions/cache/restore@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
@@ -63,7 +63,7 @@ jobs:
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
- name: Configure Git
run: |
@@ -91,7 +91,7 @@ jobs:
- name: Create Release
id: create-release
- uses: shogo82148/actions-create-release@559c27ce7eb834825e2b55927c64f6d1bd1db716 # v1
+ uses: shogo82148/actions-create-release@6a396031bc74c57403da1018fec74d24c6aa03cd # v1
with:
tag_name: v${{ steps.version.outputs.release }}
release_name: v${{ steps.version.outputs.release }}
@@ -115,7 +115,7 @@ jobs:
needs: [prepare-release]
timeout-minutes: 60
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
- name: Init Git and pull
run: |
@@ -163,7 +163,7 @@ jobs:
needs: [prepare-release]
timeout-minutes: 15
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
- name: Init Git and pull
run: |
@@ -179,7 +179,7 @@ jobs:
# Try to reuse existing cache from check-build
- name: Try restore Maven Cache
- uses: actions/cache/restore@v5
+ uses: actions/cache/restore@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
@@ -191,7 +191,7 @@ jobs:
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
- name: Deploy to Github pages
- uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
+ uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site
@@ -202,7 +202,7 @@ jobs:
needs: [publish-maven]
timeout-minutes: 10
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
- name: Init Git and pull
run: |
diff --git a/.github/workflows/report-gha-workflow-security-problems.yml b/.github/workflows/report-gha-workflow-security-problems.yml
new file mode 100644
index 00000000..78470285
--- /dev/null
+++ b/.github/workflows/report-gha-workflow-security-problems.yml
@@ -0,0 +1,61 @@
+name: Report workflow security problems
+
+on:
+ workflow_dispatch:
+ push:
+ branches: [ develop ]
+ paths:
+ - '.github/workflows/**'
+
+permissions:
+ issues: write
+
+jobs:
+ prt:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ # Only run this in our repos (Prevent notification spam by forks)
+ if: ${{ github.repository_owner == 'xdev-software' }}
+ steps:
+ - uses: actions/checkout@v7
+
+ - name: Check
+ id: check
+ run: |
+ grep -l 'pull_request_target:' --exclude report-gha-workflow-security-problems.yml *.yml > reported.txt && exit 1 || exit 0
+ working-directory: .github/workflows
+
+ - name: Find already existing issue
+ id: find-issue
+ if: ${{ !cancelled() }}
+ run: |
+ echo "number=$(gh issue list -l 'bug' -l 'automated' -L 1 -S 'in:title "Incorrectly configure GHA workflow (prt)"' -s 'open' --json 'number' --jq '.[].number')" >> $GITHUB_OUTPUT
+ env:
+ GH_TOKEN: ${{ github.token }}
+
+ - name: Close issue if everything is fine
+ if: ${{ success() && steps.find-issue.outputs.number != '' }}
+ run: gh issue close -r 'not planned' ${{ steps.find-issue.outputs.number }}
+ env:
+ GH_TOKEN: ${{ github.token }}
+
+ - name: Create report
+ if: ${{ failure() && steps.check.conclusion == 'failure' }}
+ run: |
+ echo 'Detected usage of `pull_request_target`. This event is dangerous and MUST NOT BE USED AT ALL COST!' > reported.md
+ echo '' >> reported.md
+ echo '/cc @xdev-software/gha-workflow-security' >> reported.md
+ echo '' >> reported.md
+ echo '```' >> reported.md
+ cat .github/workflows/reported.txt >> reported.md
+ echo '```' >> reported.md
+ cat reported.md
+
+ - name: Create Issue From File
+ if: ${{ failure() && steps.check.conclusion == 'failure' }}
+ uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6
+ with:
+ issue-number: ${{ steps.find-issue.outputs.number }}
+ title: 'Incorrectly configure GHA workflow (prt)'
+ content-filepath: ./reported.md
+ labels: bug, automated
diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml
index 6471ce7c..dc68d05d 100644
--- a/.github/workflows/sync-labels.yml
+++ b/.github/workflows/sync-labels.yml
@@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
with:
sparse-checkout: .github/labels.yml
diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml
index 2d13d77a..96e5d2a7 100644
--- a/.github/workflows/test-deploy.yml
+++ b/.github/workflows/test-deploy.yml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@v7
- name: Set up JDK
uses: actions/setup-java@v5
diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml
deleted file mode 100644
index a2462d6a..00000000
--- a/.github/workflows/update-from-template.yml
+++ /dev/null
@@ -1,320 +0,0 @@
-name: Update from Template
-
-# This workflow keeps the repo up to date with changes from the template repo (REMOTE_URL)
-# It duplicates the REMOTE_BRANCH (into UPDATE_BRANCH) and tries to merge it into
-# this repos default branch (which is checked out here)
-# Note that this requires a PAT (Personal Access Token) - at best from a servicing account
-# PAT permissions: read:discussion, read:org, repo, workflow
-# Also note that you should have at least once merged the template repo into the current repo manually
-# otherwise a "refusing to merge unrelated histories" error might occur.
-
-on:
- schedule:
- - cron: '55 2 * * 1'
- workflow_dispatch:
- inputs:
- no_automatic_merge:
- type: boolean
- description: 'No automatic merge'
- default: false
-
-env:
- UPDATE_BRANCH: update-from-template
- UPDATE_BRANCH_MERGED: update-from-template-merged
- REMOTE_URL: https://github.com/xdev-software/openapi-client-maven-template.git
- REMOTE_BRANCH: master
-
-permissions:
- contents: write
- pull-requests: write
-
-jobs:
- update:
- runs-on: ubuntu-latest
- timeout-minutes: 60
- outputs:
- update_branch_merged_commit: ${{ steps.manage-branches.outputs.update_branch_merged_commit }}
- create_update_branch_merged_pr: ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }}
- steps:
- - uses: actions/checkout@v6
- with:
- # Required because otherwise there are always changes detected when executing diff/rev-list
- fetch-depth: 0
- # If no PAT is used the following error occurs on a push:
- # refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission
- token: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
-
- - name: Init Git
- run: |
- git config --global user.email "111048771+xdev-gh-bot@users.noreply.github.com"
- git config --global user.name "XDEV Bot"
-
- - name: Manage branches
- id: manage-branches
- run: |
- echo "Adding remote template-repo"
- git remote add template ${{ env.REMOTE_URL }}
-
- echo "Fetching remote template repo"
- git fetch template
-
- echo "Deleting local branches that will contain the updates - if present"
- git branch -D ${{ env.UPDATE_BRANCH }} || true
- git branch -D ${{ env.UPDATE_BRANCH_MERGED }} || true
-
- echo "Checking if the remote template repo has new commits"
- git rev-list ..template/${{ env.REMOTE_BRANCH }}
-
- if [ $(git rev-list --count ..template/${{ env.REMOTE_BRANCH }}) -eq 0 ]; then
- echo "There are no commits new commits on the template repo"
-
- echo "Deleting origin branch(es) that contain the updates - if present"
- git push -f origin --delete ${{ env.UPDATE_BRANCH }} || true
- git push -f origin --delete ${{ env.UPDATE_BRANCH_MERGED }} || true
-
- echo "create_update_branch_pr=0" >> $GITHUB_OUTPUT
- echo "create_update_branch_merged_pr=0" >> $GITHUB_OUTPUT
- exit 0
- fi
-
- echo "Found new commits on the template repo"
-
- echo "Creating update branch"
- git branch ${{ env.UPDATE_BRANCH }} template/${{ env.REMOTE_BRANCH }}
- git branch --unset-upstream ${{ env.UPDATE_BRANCH }}
-
- echo "Pushing update branch"
- git push -f -u origin ${{ env.UPDATE_BRANCH }}
-
- echo "Getting base branch"
- base_branch=$(git branch --show-current)
- echo "Base branch is $base_branch"
- echo "base_branch=$base_branch" >> $GITHUB_OUTPUT
-
- echo "Trying to create auto-merged branch ${{ env.UPDATE_BRANCH_MERGED }}"
- git branch ${{ env.UPDATE_BRANCH_MERGED }} ${{ env.UPDATE_BRANCH }}
- git checkout ${{ env.UPDATE_BRANCH_MERGED }}
-
- echo "Merging branch $base_branch into ${{ env.UPDATE_BRANCH_MERGED }}"
- git merge $base_branch && merge_exit_code=$? || merge_exit_code=$?
- if [ $merge_exit_code -ne 0 ]; then
- echo "Auto merge failed! Manual merge required"
- echo "::notice ::Auto merge failed - Manual merge required"
-
- echo "Cleaning up failed merge"
- git merge --abort
- git checkout $base_branch
- git branch -D ${{ env.UPDATE_BRANCH_MERGED }} || true
-
- echo "Deleting auto-merge branch - if present"
- git push -f origin --delete ${{ env.UPDATE_BRANCH_MERGED }} || true
-
- echo "create_update_branch_pr=1" >> $GITHUB_OUTPUT
- echo "create_update_branch_merged_pr=0" >> $GITHUB_OUTPUT
- exit 0
- fi
-
- echo "Post processing: Trying to automatically fill in template variables"
- find . -type f \
- -not -path "./.git/**" \
- -not -path "./.github/workflows/update-from-template.yml" -print0 \
- | xargs -0 sed -i "s/template-placeholder/${GITHUB_REPOSITORY#*/}/g"
-
- git status
- git add --all
-
- if [[ "$(git status --porcelain)" != "" ]]; then
- echo "Filled in template; Committing"
-
- git commit -m "Fill in template"
- fi
-
- echo "Pushing auto-merged branch"
- git push -f -u origin ${{ env.UPDATE_BRANCH_MERGED }}
-
- echo "update_branch_merged_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
-
- echo "Restoring base branch $base_branch"
- git checkout $base_branch
-
- echo "create_update_branch_pr=0" >> $GITHUB_OUTPUT
- echo "create_update_branch_merged_pr=1" >> $GITHUB_OUTPUT
- echo "try_close_update_branch_pr=1" >> $GITHUB_OUTPUT
-
- - name: Create/Update PR update_branch
- if: steps.manage-branches.outputs.create_update_branch_pr == 1
- env:
- GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
- run: |
- gh_pr_up() {
- gh pr create -H "${{ env.UPDATE_BRANCH }}" "$@" || (git checkout "${{ env.UPDATE_BRANCH }}" && gh pr edit "$@")
- }
- gh_pr_up -B "${{ steps.manage-branches.outputs.base_branch }}" \
- --title "Update from template" \
- --body "An automated PR to sync changes from the template into this repo"
-
- # Ensure that only a single PR is open (otherwise confusion and spam)
- - name: Close PR update_branch
- if: steps.manage-branches.outputs.try_close_update_branch_pr == 1
- env:
- GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
- run: |
- gh pr close "${{ env.UPDATE_BRANCH }}" || true
-
- - name: Create/Update PR update_branch_merged
- if: steps.manage-branches.outputs.create_update_branch_merged_pr == 1
- env:
- GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
- run: |
- gh_pr_up() {
- gh pr create -H "${{ env.UPDATE_BRANCH_MERGED }}" "$@" || (git checkout "${{ env.UPDATE_BRANCH_MERGED }}" && gh pr edit "$@")
- }
- gh_pr_up -B "${{ steps.manage-branches.outputs.base_branch }}" \
- --title "Update from template (auto-merged)" \
- --body "An automated PR to sync changes from the template into this repo"
-
- # Wait a moment so that checks of PR have higher prio than following job
- sleep 3
-
- # Split into two jobs to help with executor starvation
- auto-merge:
- needs: [update]
- if: needs.update.outputs.create_update_branch_merged_pr == 1
- runs-on: ubuntu-latest
- timeout-minutes: 60
- steps:
- - uses: actions/checkout@v6
- with:
- # Required because otherwise there are always changes detected when executing diff/rev-list
- fetch-depth: 0
- # If no PAT is used the following error occurs on a push:
- # refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission
- token: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
-
- - name: Init Git
- run: |
- git config --global user.email "111048771+xdev-gh-bot@users.noreply.github.com"
- git config --global user.name "XDEV Bot"
-
- - name: Checking if auto-merge for PR update_branch_merged can be done
- id: auto-merge-check
- env:
- GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
- run: |
- not_failed_conclusion="skipped|neutral|success"
- not_relevant_app_slug="dependabot|github-pages|sonarqubecloud"
-
- echo "Waiting for checks to start..."
- sleep 40s
-
- for i in {1..20}; do
- echo "Checking if PR can be auto-merged. Try: $i"
-
- echo "Checking if update-branch-merged exists"
- git fetch
- if [[ $(git ls-remote --heads origin refs/heads/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
- echo "Branch still exists; Continuing..."
- else
- echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing"
- exit 0
- fi
-
- echo "Fetching checks"
- cs_response=$(curl -sL \
- --fail-with-body \
- --connect-timeout 60 \
- --max-time 120 \
- -H "Accept: application/vnd.github+json" \
- -H "Authorization: Bearer $GH_TOKEN" \
- -H "X-GitHub-Api-Version: 2022-11-28" \
- https://api.github.com/repos/${{ github.repository }}/commits/${{ needs.update.outputs.update_branch_merged_commit }}/check-suites)
-
- cs_data=$(echo $cs_response | jq '.check_suites[] | { conclusion: .conclusion, slug: .app.slug, check_runs_url: .check_runs_url }')
- echo $cs_data
-
- if [[ -z "$cs_data" ]]; then
- echo "No check suite data - Assuming that there are no checks to run"
-
- echo "perform=1" >> $GITHUB_OUTPUT
- exit 0
- fi
-
- cs_failed=$(echo $cs_data | jq --arg x "$not_failed_conclusion" 'select ((.conclusion == null or (.conclusion | test($x))) | not)')
- if [[ -z "$cs_failed" ]]; then
- echo "No check failed so far; Checking if relevant checks are still running"
-
- cs_relevant_still_running=$(echo $cs_data | jq --arg x "$not_relevant_app_slug" 'select (.conclusion == null and (.slug | test($x) | not))')
- if [[ -z $cs_relevant_still_running ]]; then
- echo "All relevant checks finished - PR can be merged"
-
- echo "perform=1" >> $GITHUB_OUTPUT
- exit 0
- else
- echo "Relevant checks are still running"
- echo $cs_relevant_still_running
- fi
- else
- echo "Detected failed check"
- echo $cs_failed
-
- echo "perform=0" >> $GITHUB_OUTPUT
- exit 0
- fi
-
- echo "Waiting before next run..."
- sleep 30s
- done
-
- echo "Timed out - Assuming executor starvation - Forcing merge"
- echo "perform=1" >> $GITHUB_OUTPUT
-
- - name: Auto-merge update_branch_merged
- if: steps.auto-merge-check.outputs.perform == 1
- run: |
- echo "Getting base branch"
- base_branch=$(git branch --show-current)
- echo "Base branch is $base_branch"
-
- echo "Fetching..."
- git fetch
- if [[ $(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
- echo "Branch still exists; Continuing..."
- else
- echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing"
- exit 0
- fi
-
- expected_commit="${{ needs.update.outputs.update_branch_merged_commit }}"
- actual_commit=$(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }})
- if [[ "$expected_commit" != "$actual_commit" ]]; then
- echo "Branch ${{ env.UPDATE_BRANCH_MERGED }} contains unexpected commit $actual_commit"
- echo "Expected: $expected_commit"
-
- exit 0
- fi
-
- echo "Ensuring that current branch $base_branch is up-to-date"
- git pull
-
- echo "Merging origin/${{ env.UPDATE_BRANCH_MERGED }} into $base_branch"
- git merge origin/${{ env.UPDATE_BRANCH_MERGED }} && merge_exit_code=$? || merge_exit_code=$?
- if [ $merge_exit_code -ne 0 ]; then
- echo "Unexpected merge failure $merge_exit_code - Requires manual resolution"
-
- exit 0
- fi
-
- if [[ "${{ inputs.no_automatic_merge }}" == "true" ]]; then
- echo "Exiting due no_automatic_merge"
-
- exit 0
- fi
-
- echo "Pushing"
- git push
-
- echo "Cleaning up"
- git branch -D ${{ env.UPDATE_BRANCH }} || true
- git branch -D ${{ env.UPDATE_BRANCH_MERGED }} || true
- git push -f origin --delete ${{ env.UPDATE_BRANCH }} || true
- git push -f origin --delete ${{ env.UPDATE_BRANCH_MERGED }} || true
diff --git a/.idea/PMDPlugin.xml b/.idea/PMDPlugin.xml
deleted file mode 100644
index 0936e518..00000000
--- a/.idea/PMDPlugin.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
index a751c417..b8b753e6 100644
--- a/.idea/checkstyle-idea.xml
+++ b/.idea/checkstyle-idea.xml
@@ -1,7 +1,7 @@
- 13.0.0
+ latest
JavaOnlyWithTests
true
true
diff --git a/.idea/externalDependencies.xml b/.idea/externalDependencies.xml
index 78be5b8e..0b477b88 100644
--- a/.idea/externalDependencies.xml
+++ b/.idea/externalDependencies.xml
@@ -3,5 +3,6 @@
+
\ No newline at end of file
diff --git a/.idea/pmd-x.xml b/.idea/pmd-x.xml
index 260e454b..7b3b48fa 100644
--- a/.idea/pmd-x.xml
+++ b/.idea/pmd-x.xml
@@ -10,6 +10,7 @@
+ .config/pmd/java/ruleset.xml
(bundled)
(bundled)
(bundled)
@@ -20,7 +21,6 @@
(bundled)
(bundled)
(bundled)
- $PROJECT_DIR$/.config/pmd/java/ruleset.xml
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index 8dea6c22..216df058 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1,3 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
-distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c24cb6e1..eb0f83b6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+# 1.3.0
+* Updated to Jackson v3
+* Regenerated code with latest OpenApi Generator version
+* Updated dependencies
+
# 1.2.8
* Regenerated code with latest OpenApi Generator version
* Updated dependencies
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ea8ffdd6..7150cab7 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,7 +4,7 @@ We would absolutely love to get the community involved, and we welcome any form
### Communication channels
* Communication is primarily done using issues.
-* If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).
+* If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services-products/support).
* As a last resort measure or on otherwise important matter you may also [contact us directly](https://xdev.software/en/about-us/contact).
### Ways to help
@@ -12,7 +12,7 @@ We would absolutely love to get the community involved, and we welcome any form
* **Send pull requests**
If you want to contribute code, check out the development instructions below.
* However when contributing larger new features, please first discuss the change you wish to make via issue with the owners of this repository before making it.
Otherwise your work might be rejected and your effort was pointless.
-We also encourage you to read the [contribution instructions by GitHub](https://docs.github.com/en/get-started/quickstart/contributing-to-projects).
+We also encourage you to read the [contribution instructions by GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project).
## Developing
@@ -20,17 +20,17 @@ We also encourage you to read the [contribution instructions by GitHub](https://
You should have the following things installed:
* Git
* Java 25 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/))
-* Maven (Note that the [Maven Wrapper](https://maven.apache.org/wrapper/) is shipped with the repo)
+* Maven (Note that the [Maven Wrapper](https://maven.apache.org/tools/wrapper/) is shipped with the repo)
### Recommended setup
-* Install ``IntelliJ`` (Community Edition is sufficient)
- * Install the following plugins:
- * [Save Actions](https://plugins.jetbrains.com/plugin/22113) - Provides save actions, like running the formatter or adding ``final`` to fields
- * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis
- * You may consider disabling telemetry in the settings under ``Tools > Sonarlint -> About``
- * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis
+* Install `IntelliJ`
+ * Recommended setup actions
+ * Disable not needed plugins
+ * Disable [telemetry](https://www.jetbrains.com/help/idea/settings-usage-statistics.html)
+ * Configure the available memory
* Import the project
- * Ensure that everything is encoded in ``UTF-8``
+ * You will get prompted to install the required plugins
+ * Ensure that everything is encoded in `UTF-8`
* Ensure that the JDK/Java-Version is correct
diff --git a/README.md b/README.md
index e2419480..a310c269 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@ Sessionize API ``v2``:
A minimal demo is also available [here](./sessionize-java-client-demo/src/main/java/software/xdev/Application.java).
## Support
-If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).
+If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services-products/support).
## Contributing
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.
diff --git a/pom.xml b/pom.xml
index 721b097f..993509cd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,7 @@
com.puppycrawl.tools
checkstyle
- 13.0.0
+ 13.9.0
@@ -83,12 +83,12 @@
net.sourceforge.pmd
pmd-core
- 7.20.0
+ 7.26.0
net.sourceforge.pmd
pmd-java
- 7.20.0
+ 7.26.0
diff --git a/sessionize-java-client-demo/pom.xml b/sessionize-java-client-demo/pom.xml
index 16e965ff..862fb936 100644
--- a/sessionize-java-client-demo/pom.xml
+++ b/sessionize-java-client-demo/pom.xml
@@ -28,7 +28,7 @@
software.xdev.Application
- 2.25.3
+ 2.26.1
@@ -59,7 +59,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.14.1
+ 3.15.0
${maven.compiler.release}
diff --git a/sessionize-java-client/pom.xml b/sessionize-java-client/pom.xml
index c1c86c25..fc87b546 100644
--- a/sessionize-java-client/pom.xml
+++ b/sessionize-java-client/pom.xml
@@ -51,47 +51,24 @@
src/generated/java
-
-
-
- com.fasterxml.jackson
- jackson-bom
- 2.21.0
- pom
- import
-
-
-
-
org.apache.httpcomponents.client5
httpclient5
- 5.6
+ 5.6.3
- com.fasterxml.jackson.core
- jackson-core
-
-
- com.fasterxml.jackson.core
- jackson-annotations
-
-
- com.fasterxml.jackson.core
+ tools.jackson.core
jackson-databind
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
+ 3.2.1
org.openapitools
jackson-databind-nullable
- 0.2.8
+ 0.2.11
@@ -120,7 +97,7 @@
com.mycila
license-maven-plugin
- 5.0.0
+ 5.1.1
${project.organization.url}
@@ -149,7 +126,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.14.1
+ 3.15.0
${maven.compiler.release}
@@ -218,7 +195,7 @@
org.codehaus.mojo
flatten-maven-plugin
- 1.7.3
+ 1.8.0
ossrh
@@ -264,7 +241,7 @@
org.sonatype.central
central-publishing-maven-plugin
- 0.10.0
+ 0.11.0
true
sonatype-central-portal
@@ -319,7 +296,7 @@
org.openapitools
openapi-generator-maven-plugin
- 7.18.0
+ 7.24.0
@@ -342,6 +319,7 @@
true
true
+ true
false
@@ -355,7 +333,7 @@
org.apache.maven.plugins
maven-resources-plugin
- 3.4.0
+ 3.5.0
copy-generated-resources
@@ -377,7 +355,7 @@
software.xdev
find-and-replace-maven-plugin
- 1.0.4
+ 1.0.5
@@ -444,7 +422,7 @@
com.puppycrawl.tools
checkstyle
- 13.0.0
+ 13.9.0
@@ -486,12 +464,12 @@
net.sourceforge.pmd
pmd-core
- 7.20.0
+ 7.26.0
net.sourceforge.pmd
pmd-java
- 7.20.0
+ 7.26.0
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/AllApi.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/AllApi.java
index d394fc44..15595d3f 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/AllApi.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/AllApi.java
@@ -12,7 +12,7 @@
package software.xdev.sessionize.api;
-import com.fasterxml.jackson.core.type.TypeReference;
+import tools.jackson.core.type.TypeReference;
import software.xdev.sessionize.client.ApiException;
import software.xdev.sessionize.client.ApiClient;
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SessionsApi.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SessionsApi.java
index 412f5dff..4656ef3b 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SessionsApi.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SessionsApi.java
@@ -12,7 +12,7 @@
package software.xdev.sessionize.api;
-import com.fasterxml.jackson.core.type.TypeReference;
+import tools.jackson.core.type.TypeReference;
import software.xdev.sessionize.client.ApiException;
import software.xdev.sessionize.client.ApiClient;
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SpeakersApi.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SpeakersApi.java
index c402afde..ed6da7fe 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SpeakersApi.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/api/SpeakersApi.java
@@ -12,7 +12,7 @@
package software.xdev.sessionize.api;
-import com.fasterxml.jackson.core.type.TypeReference;
+import tools.jackson.core.type.TypeReference;
import software.xdev.sessionize.client.ApiException;
import software.xdev.sessionize.client.ApiClient;
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiClient.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiClient.java
index 5d709e9b..3df0e550 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiClient.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiClient.java
@@ -12,15 +12,34 @@
package software.xdev.sessionize.client;
-import com.fasterxml.jackson.annotation.*;
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import java.io.File;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Type;
+import java.net.URI;
+import java.net.URLEncoder;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.nio.charset.UnsupportedCharsetException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.text.DateFormat;
import java.time.OffsetDateTime;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JavaType;
-import org.openapitools.jackson.nullable.JsonNullableModule;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.apache.hc.client5.http.config.Configurable;
+import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.http.cookie.BasicCookieStore;
import org.apache.hc.client5.http.cookie.Cookie;
import org.apache.hc.client5.http.entity.UrlEncodedFormEntity;
@@ -43,56 +62,37 @@
import org.apache.hc.core5.http.io.entity.StringEntity;
import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
import org.apache.hc.core5.http.message.BasicNameValuePair;
+import org.apache.hc.core5.util.Timeout;
+import org.openapitools.jackson.nullable.JsonNullableJackson3Module;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.function.Supplier;
-import java.util.TimeZone;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import java.net.URLEncoder;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.nio.charset.UnsupportedCharsetException;
-import java.nio.file.Files;
-import java.nio.file.StandardCopyOption;
-import java.nio.file.Paths;
-import java.lang.reflect.Type;
-import java.net.URI;
-
-import java.text.DateFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
import software.xdev.sessionize.client.auth.Authentication;
+import tools.jackson.core.JacksonException;
+import tools.jackson.core.type.TypeReference;
+import tools.jackson.databind.DeserializationFeature;
+import tools.jackson.databind.ObjectMapper;
+import tools.jackson.databind.cfg.DateTimeFeature;
+import tools.jackson.databind.cfg.EnumFeature;
+import tools.jackson.databind.json.JsonMapper;
+
public class ApiClient extends JavaTimeFormatter {
- protected Map defaultHeaderMap = new HashMap();
- protected Map defaultCookieMap = new HashMap();
+ protected Map defaultHeaderMap = new HashMap<>();
+ protected Map defaultCookieMap = new HashMap<>();
protected String basePath = "https://sessionize.com";
- protected List servers = new ArrayList(Arrays.asList(
- new ServerConfiguration(
- "https://sessionize.com",
- "No description provided",
- new HashMap()
- )
+ protected List servers = new ArrayList<>(Arrays.asList(
+ new ServerConfiguration(
+ "https://sessionize.com",
+ "No description provided",
+ new HashMap<>()
+ )
));
protected Integer serverIndex = 0;
protected Map serverVariables = null;
protected boolean debugging = false;
protected int connectionTimeout = 0;
+ protected int readTimeout = 0;
protected CloseableHttpClient httpClient;
protected ObjectMapper objectMapper;
@@ -107,29 +107,30 @@ public class ApiClient extends JavaTimeFormatter {
// Methods that can have a request body
protected static List bodyMethods = Arrays.asList("POST", "PUT", "DELETE", "PATCH");
-
- public ApiClient(CloseableHttpClient httpClient) {
- objectMapper = new ObjectMapper();
- objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- objectMapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false);
- objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
- objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
- objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
- objectMapper.registerModule(new JavaTimeModule());
- objectMapper.registerModule(new JsonNullableModule());
- objectMapper.registerModule(new RFC3339JavaTimeModule());
- objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat());
-
- dateFormat = ApiClient.buildDefaultDateFormat();
+
+ public ApiClient(final CloseableHttpClient httpClient)
+ {
+ this.objectMapper = JsonMapper.builder()
+ .changeDefaultPropertyInclusion(v -> v.withValueInclusion(JsonInclude.Include.NON_NULL))
+ .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE)
+ .disable(DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS)
+ .enable(EnumFeature.WRITE_ENUMS_USING_TO_STRING)
+ .enable(EnumFeature.READ_ENUMS_USING_TO_STRING)
+ .addModule(new JsonNullableJackson3Module())
+ .addModule(new RFC3339JavaTimeModule())
+ .defaultDateFormat(ApiClient.buildDefaultDateFormat())
+ .build();
+
+ this.dateFormat = ApiClient.buildDefaultDateFormat();
// Set default User-Agent.
- setUserAgent("OpenAPI-Generator/2.0/java");
+ this.setUserAgent("OpenAPI-Generator/2.0/java");
// Setup authentications (key: authentication name, value: authentication).
- authentications = new HashMap();
+ this.authentications = new HashMap<>();
// Prevent the authentications from being modified.
- authentications = Collections.unmodifiableMap(authentications);
+ this.authentications = Collections.unmodifiableMap(this.authentications);
this.httpClient = httpClient;
}
@@ -151,7 +152,7 @@ public static DateFormat buildDefaultDateFormat() {
* @return Object mapper
*/
public ObjectMapper getObjectMapper() {
- return objectMapper;
+ return this.objectMapper;
}
/**
@@ -160,13 +161,14 @@ public ObjectMapper getObjectMapper() {
* @param objectMapper object mapper
* @return API client
*/
- public ApiClient setObjectMapper(ObjectMapper objectMapper) {
+ public ApiClient setObjectMapper(final ObjectMapper objectMapper)
+ {
this.objectMapper = objectMapper;
return this;
}
public CloseableHttpClient getHttpClient() {
- return httpClient;
+ return this.httpClient;
}
/**
@@ -175,13 +177,14 @@ public CloseableHttpClient getHttpClient() {
* @param httpClient HTTP client
* @return API client
*/
- public ApiClient setHttpClient(CloseableHttpClient httpClient) {
+ public ApiClient setHttpClient(final CloseableHttpClient httpClient)
+ {
this.httpClient = httpClient;
return this;
}
public String getBasePath() {
- return basePath;
+ return this.basePath;
}
/**
@@ -190,14 +193,15 @@ public String getBasePath() {
* @param basePath base path
* @return API client
*/
- public ApiClient setBasePath(String basePath) {
+ public ApiClient setBasePath(final String basePath)
+ {
this.basePath = basePath;
this.serverIndex = null;
return this;
}
public List getServers() {
- return servers;
+ return this.servers;
}
/**
@@ -206,13 +210,14 @@ public List getServers() {
* @param servers a list of server configuration
* @return API client
*/
- public ApiClient setServers(List servers) {
+ public ApiClient setServers(final List servers)
+ {
this.servers = servers;
return this;
}
public Integer getServerIndex() {
- return serverIndex;
+ return this.serverIndex;
}
/**
@@ -221,13 +226,14 @@ public Integer getServerIndex() {
* @param serverIndex server index
* @return API client
*/
- public ApiClient setServerIndex(Integer serverIndex) {
+ public ApiClient setServerIndex(final Integer serverIndex)
+ {
this.serverIndex = serverIndex;
return this;
}
public Map getServerVariables() {
- return serverVariables;
+ return this.serverVariables;
}
/**
@@ -236,7 +242,8 @@ public Map getServerVariables() {
* @param serverVariables server variables
* @return API client
*/
- public ApiClient setServerVariables(Map serverVariables) {
+ public ApiClient setServerVariables(final Map serverVariables)
+ {
this.serverVariables = serverVariables;
return this;
}
@@ -248,7 +255,7 @@ public ApiClient setServerVariables(Map serverVariables) {
*/
@Deprecated
public int getStatusCode() {
- return lastStatusCode.get();
+ return this.lastStatusCode.get();
}
/**
@@ -257,7 +264,7 @@ public int getStatusCode() {
*/
@Deprecated
public Map> getResponseHeaders() {
- return lastResponseHeaders.get();
+ return this.lastResponseHeaders.get();
}
/**
@@ -265,7 +272,7 @@ public Map> getResponseHeaders() {
* @return Map of authentication
*/
public Map getAuthentications() {
- return authentications;
+ return this.authentications;
}
/**
@@ -274,8 +281,9 @@ public Map getAuthentications() {
* @param authName The authentication name
* @return The authentication, null if not found
*/
- public Authentication getAuthentication(String authName) {
- return authentications.get(authName);
+ public Authentication getAuthentication(final String authName)
+ {
+ return this.authentications.get(authName);
}
/**
@@ -286,7 +294,7 @@ public Authentication getAuthentication(String authName) {
* @return Temp folder path
*/
public String getTempFolderPath() {
- return tempFolderPath;
+ return this.tempFolderPath;
}
@@ -298,8 +306,9 @@ public String getTempFolderPath() {
* @param userAgent User agent
* @return API client
*/
- public final ApiClient setUserAgent(String userAgent) {
- addDefaultHeader("User-Agent", userAgent);
+ public final ApiClient setUserAgent(final String userAgent)
+ {
+ this.addDefaultHeader("User-Agent", userAgent);
return this;
}
@@ -308,7 +317,8 @@ public final ApiClient setUserAgent(String userAgent) {
* @param tempFolderPath Temp folder path
* @return API client
*/
- public ApiClient setTempFolderPath(String tempFolderPath) {
+ public ApiClient setTempFolderPath(final String tempFolderPath)
+ {
this.tempFolderPath = tempFolderPath;
return this;
}
@@ -320,8 +330,9 @@ public ApiClient setTempFolderPath(String tempFolderPath) {
* @param value The header's value
* @return API client
*/
- public final ApiClient addDefaultHeader(String key, String value) {
- defaultHeaderMap.put(key, value);
+ public final ApiClient addDefaultHeader(final String key, final String value)
+ {
+ this.defaultHeaderMap.put(key, value);
return this;
}
@@ -332,8 +343,9 @@ public final ApiClient addDefaultHeader(String key, String value) {
* @param value The cookie's value
* @return API client
*/
- public ApiClient addDefaultCookie(String key, String value) {
- defaultCookieMap.put(key, value);
+ public ApiClient addDefaultCookie(final String key, final String value)
+ {
+ this.defaultCookieMap.put(key, value);
return this;
}
@@ -342,7 +354,7 @@ public ApiClient addDefaultCookie(String key, String value) {
* @return True if debugging is on
*/
public boolean isDebugging() {
- return debugging;
+ return this.debugging;
}
/**
@@ -351,7 +363,8 @@ public boolean isDebugging() {
* @param debugging To enable (true) or disable (false) debugging
* @return API client
*/
- public ApiClient setDebugging(boolean debugging) {
+ public ApiClient setDebugging(final boolean debugging)
+ {
// TODO: implement debugging mode
this.debugging = debugging;
return this;
@@ -362,27 +375,67 @@ public ApiClient setDebugging(boolean debugging) {
* @return Connection timeout
*/
public int getConnectTimeout() {
- return connectionTimeout;
+ return this.connectionTimeout;
}
/**
* Set the connect timeout (in milliseconds).
- * A value of 0 means no timeout, otherwise values must be between 1 and
- * {@link Integer#MAX_VALUE}.
+ * A value of 0 means the HTTP client's default connect timeout is used,
+ * otherwise values must be between 1 and {@link Integer#MAX_VALUE}.
+ * The timeout is applied to each request via its request configuration;
+ * other request configuration defaults of the underlying HTTP client
+ * are preserved.
* @param connectionTimeout Connection timeout in milliseconds
* @return API client
+ * @throws IllegalArgumentException if connectionTimeout is negative
*/
- public ApiClient setConnectTimeout(int connectionTimeout) {
- this.connectionTimeout = connectionTimeout;
- return this;
- }
+ public ApiClient setConnectTimeout(final int connectionTimeout)
+ {
+ if(connectionTimeout < 0)
+ {
+ throw new IllegalArgumentException("connectionTimeout must not be negative");
+ }
+ this.connectionTimeout = connectionTimeout;
+ return this;
+ }
+
+ /**
+ * Read timeout (in milliseconds).
+ *
+ * @return Read timeout
+ */
+ public int getReadTimeout()
+ {
+ return this.readTimeout;
+ }
+
+ /**
+ * Set the read timeout (in milliseconds), i.e. the response timeout while waiting for data after the connection is
+ * established. A value of 0 means the HTTP client's default response timeout is used, otherwise values must be
+ * between 1 and {@link Integer#MAX_VALUE}. The timeout is applied to each request via its request configuration;
+ * other request configuration defaults of the underlying HTTP client are preserved.
+ *
+ * @param readTimeout Read timeout in milliseconds
+ * @return API client
+ * @throws IllegalArgumentException if readTimeout is negative
+ */
+ public ApiClient setReadTimeout(final int readTimeout)
+ {
+ if(readTimeout < 0)
+ {
+ throw new IllegalArgumentException("readTimeout must not be negative");
+ }
+ this.readTimeout = readTimeout;
+ return this;
+ }
/**
* Get the date format used to parse/format date parameters.
* @return Date format
*/
- public DateFormat getDateFormat() {
- return dateFormat;
+ public DateFormat getDateFormat()
+ {
+ return this.dateFormat;
}
/**
@@ -390,10 +443,19 @@ public DateFormat getDateFormat() {
* @param dateFormat Date format
* @return API client
*/
- public ApiClient setDateFormat(DateFormat dateFormat) {
+ public ApiClient setDateFormat(final DateFormat dateFormat) {
this.dateFormat = dateFormat;
// Also set the date format for model (de)serialization with Date properties.
- this.objectMapper.setDateFormat((DateFormat) dateFormat.clone());
+ if(this.objectMapper instanceof JsonMapper)
+ {
+ this.objectMapper =
+ ((JsonMapper)this.objectMapper).rebuild().defaultDateFormat((DateFormat)dateFormat.clone()).build();
+ }
+ else
+ {
+ throw new UnsupportedOperationException(
+ "setDateFormat is only supported when objectMapper is a JsonMapper instance");
+ }
return this;
}
@@ -402,10 +464,13 @@ public ApiClient setDateFormat(DateFormat dateFormat) {
* @param str String
* @return Date
*/
- public Date parseDate(String str) {
- try {
- return dateFormat.parse(str);
- } catch (java.text.ParseException e) {
+ public Date parseDate(final String str)
+ {
+ try
+ {
+ return this.dateFormat.parse(str);
+ }
+ catch(final java.text.ParseException e) {
throw new RuntimeException(e);
}
}
@@ -415,8 +480,9 @@ public Date parseDate(String str) {
* @param date Date
* @return Date in string format
*/
- public String formatDate(Date date) {
- return dateFormat.format(date);
+ public String formatDate(final Date date)
+ {
+ return this.dateFormat.format(date);
}
/**
@@ -424,16 +490,19 @@ public String formatDate(Date date) {
* @param param Object
* @return Object in string format
*/
- public String parameterToString(Object param) {
+ public String parameterToString(final Object param) {
if (param == null) {
return "";
- } else if (param instanceof Date) {
- return formatDate((Date) param);
- } else if (param instanceof OffsetDateTime) {
- return formatOffsetDateTime((OffsetDateTime) param);
- } else if (param instanceof Collection) {
- StringBuilder b = new StringBuilder();
- for(Object o : (Collection>)param) {
+ } else if (param instanceof Date)
+ {
+ return this.formatDate((Date) param);
+ } else if (param instanceof OffsetDateTime)
+ {
+ return this.formatOffsetDateTime((OffsetDateTime) param);
+ } else if (param instanceof Collection)
+ {
+ final StringBuilder b = new StringBuilder();
+ for(final Object o : (Collection>)param) {
if(b.length() > 0) {
b.append(',');
}
@@ -454,15 +523,16 @@ public String parameterToString(Object param) {
* @param value The value of the parameter.
* @return A list containing a single {@code Pair} object.
*/
- public List parameterToPair(String name, Object value) {
- List params = new ArrayList();
+ public List parameterToPair(final String name, final Object value)
+ {
+ final List params = new ArrayList<>();
// preconditions
if (name == null || name.isEmpty() || value == null || value instanceof Collection) {
return params;
}
-
- params.add(new Pair(name, escapeString(parameterToString(value))));
+
+ params.add(new Pair(name, this.escapeString(this.parameterToString(value))));
return params;
}
@@ -476,8 +546,9 @@ public List parameterToPair(String name, Object value) {
* @param value The value of the parameter.
* @return A list of {@code Pair} objects.
*/
- public List parameterToPairs(String collectionFormat, String name, Collection> value) {
- List params = new ArrayList();
+ public List parameterToPairs(final String collectionFormat, final String name, final Collection> value)
+ {
+ final List params = new ArrayList<>();
// preconditions
if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
@@ -485,9 +556,11 @@ public List parameterToPairs(String collectionFormat, String name, Collect
}
// create the params based on the collection format
- if ("multi".equals(collectionFormat)) {
- for (Object item : value) {
- params.add(new Pair(name, escapeString(parameterToString(item))));
+ if ("multi".equals(collectionFormat))
+ {
+ for(final Object item : value)
+ {
+ params.add(new Pair(name, this.escapeString(this.parameterToString(item))));
}
return params;
}
@@ -497,18 +570,21 @@ public List parameterToPairs(String collectionFormat, String name, Collect
// escape all delimiters except commas, which are URI reserved
// characters
- if ("ssv".equals(collectionFormat)) {
- delimiter = escapeString(" ");
- } else if ("tsv".equals(collectionFormat)) {
- delimiter = escapeString("\t");
- } else if ("pipes".equals(collectionFormat)) {
- delimiter = escapeString("|");
+ if ("ssv".equals(collectionFormat))
+ {
+ delimiter = this.escapeString(" ");
+ } else if ("tsv".equals(collectionFormat))
+ {
+ delimiter = this.escapeString("\t");
+ } else if ("pipes".equals(collectionFormat))
+ {
+ delimiter = this.escapeString("|");
}
-
- StringBuilder sb = new StringBuilder() ;
- for (Object item : value) {
+
+ final StringBuilder sb = new StringBuilder();
+ for(final Object item : value) {
sb.append(delimiter);
- sb.append(escapeString(parameterToString(item)));
+ sb.append(this.escapeString(this.parameterToString(item)));
}
params.add(new Pair(name, sb.substring(delimiter.length())));
@@ -526,8 +602,9 @@ public List parameterToPairs(String collectionFormat, String name, Collect
* @param mime MIME
* @return True if MIME type is boolean
*/
- public boolean isJsonMime(String mime) {
- String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
+ public boolean isJsonMime(final String mime)
+ {
+ final String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
@@ -540,12 +617,13 @@ public boolean isJsonMime(String mime) {
* @return The Accept header to use. If the given array is empty,
* null will be returned (not to set the Accept header explicitly).
*/
- public String selectHeaderAccept(String[] accepts) {
+ public String selectHeaderAccept(final String[] accepts) {
if (accepts.length == 0) {
return null;
}
- for (String accept : accepts) {
- if (isJsonMime(accept)) {
+ for(final String accept : accepts)
+ {
+ if(this.isJsonMime(accept)) {
return accept;
}
}
@@ -561,12 +639,13 @@ public String selectHeaderAccept(String[] accepts) {
* @return The Content-Type header to use. If the given array is empty,
* or matches "any", JSON will be used.
*/
- public String selectHeaderContentType(String[] contentTypes) {
+ public String selectHeaderContentType(final String[] contentTypes) {
if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) {
return "application/json";
}
- for (String contentType : contentTypes) {
- if (isJsonMime(contentType)) {
+ for(final String contentType : contentTypes)
+ {
+ if(this.isJsonMime(contentType)) {
return contentType;
}
}
@@ -578,10 +657,11 @@ public String selectHeaderContentType(String[] contentTypes) {
* @param str String
* @return Escaped string
*/
- public String escapeString(String str) {
+ public String escapeString(final String str) {
try {
return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
- } catch (UnsupportedEncodingException e) {
+ }
+ catch(final UnsupportedEncodingException e) {
return str;
}
}
@@ -592,9 +672,10 @@ public String escapeString(String str) {
* @param headers HTTP headers
* @return a map of string array
*/
- protected Map> transformResponseHeaders(Header[] headers) {
- Map> headersMap = new HashMap<>();
- for (Header header : headers) {
+ protected Map> transformResponseHeaders(final Header[] headers)
+ {
+ final Map> headersMap = new HashMap<>();
+ for(final Header header : headers) {
List valuesList = headersMap.get(header.getName());
if (valuesList != null) {
valuesList.add(header.getValue());
@@ -610,10 +691,11 @@ protected Map> transformResponseHeaders(Header[] headers) {
/**
* Parse content type object from header value
*/
- protected ContentType getContentType(String headerValue) throws ApiException {
+ protected ContentType getContentType(final String headerValue) throws ApiException {
try {
return ContentType.parse(headerValue);
- } catch (UnsupportedCharsetException e) {
+ }
+ catch(final UnsupportedCharsetException e) {
throw new ApiException("Could not parse content type " + headerValue);
}
}
@@ -621,10 +703,12 @@ protected ContentType getContentType(String headerValue) throws ApiException {
/**
* Get content type of a response or null if one was not provided
*/
- protected String getResponseMimeType(HttpResponse response) throws ApiException {
- Header contentTypeHeader = response.getFirstHeader("Content-Type");
- if (contentTypeHeader != null) {
- return getContentType(contentTypeHeader.getValue()).getMimeType();
+ protected String getResponseMimeType(final HttpResponse response) throws ApiException
+ {
+ final Header contentTypeHeader = response.getFirstHeader("Content-Type");
+ if (contentTypeHeader != null)
+ {
+ return this.getContentType(contentTypeHeader.getValue()).getMimeType();
}
return null;
}
@@ -638,38 +722,55 @@ protected String getResponseMimeType(HttpResponse response) throws ApiException
* @return Object
* @throws ApiException API exception
*/
- public HttpEntity serialize(Object obj, Map formParams, ContentType contentType) throws ApiException {
- String mimeType = contentType.getMimeType();
- if (isJsonMime(mimeType)) {
- try {
- return new StringEntity(objectMapper.writeValueAsString(obj), contentType.withCharset(StandardCharsets.UTF_8));
- } catch (JsonProcessingException e) {
+ public HttpEntity serialize(final Object obj, final Map formParams, final ContentType contentType)
+ throws ApiException
+ {
+ final String mimeType = contentType.getMimeType();
+ if(this.isJsonMime(mimeType))
+ {
+ try
+ {
+ return new StringEntity(
+ this.objectMapper.writeValueAsString(obj),
+ contentType.withCharset(StandardCharsets.UTF_8));
+ }
+ catch(final JacksonException e) {
throw new ApiException(e);
}
- } else if (mimeType.equals(ContentType.MULTIPART_FORM_DATA.getMimeType())) {
- MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create();
- for (Entry paramEntry : formParams.entrySet()) {
- Object value = paramEntry.getValue();
+ } else if (mimeType.equals(ContentType.MULTIPART_FORM_DATA.getMimeType()))
+ {
+ final MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create();
+ for(final Entry paramEntry : formParams.entrySet())
+ {
+ final Object value = paramEntry.getValue();
if (value instanceof File) {
multiPartBuilder.addBinaryBody(paramEntry.getKey(), (File) value);
} else if (value instanceof byte[]) {
multiPartBuilder.addBinaryBody(paramEntry.getKey(), (byte[]) value);
- } else {
- Charset charset = contentType.getCharset();
- if (charset != null) {
- ContentType customContentType = ContentType.create(ContentType.TEXT_PLAIN.getMimeType(), charset);
- multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue()),
+ }
+ else
+ {
+ final Charset charset = contentType.getCharset();
+ if(charset != null)
+ {
+ final ContentType customContentType = ContentType.create(ContentType.TEXT_PLAIN.getMimeType(), charset);
+ multiPartBuilder.addTextBody(
+ paramEntry.getKey(), this.parameterToString(paramEntry.getValue()),
customContentType);
- } else {
- multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue()));
+ }
+ else
+ {
+ multiPartBuilder.addTextBody(paramEntry.getKey(), this.parameterToString(paramEntry.getValue()));
}
}
}
return multiPartBuilder.build();
- } else if (mimeType.equals(ContentType.APPLICATION_FORM_URLENCODED.getMimeType())) {
- List formValues = new ArrayList<>();
- for (Entry paramEntry : formParams.entrySet()) {
- formValues.add(new BasicNameValuePair(paramEntry.getKey(), parameterToString(paramEntry.getValue())));
+ } else if (mimeType.equals(ContentType.APPLICATION_FORM_URLENCODED.getMimeType()))
+ {
+ final List formValues = new ArrayList<>();
+ for(final Entry paramEntry : formParams.entrySet())
+ {
+ formValues.add(new BasicNameValuePair(paramEntry.getKey(), this.parameterToString(paramEntry.getValue())));
}
return new UrlEncodedFormEntity(formValues, contentType.getCharset());
} else {
@@ -694,33 +795,37 @@ public HttpEntity serialize(Object obj, Map formParams, ContentT
* @throws IOException IO exception
*/
@SuppressWarnings("unchecked")
- public T deserialize(CloseableHttpResponse response, TypeReference valueType) throws ApiException, IOException, ParseException {
+ public T deserialize(final CloseableHttpResponse response, final TypeReference valueType)
+ throws ApiException, IOException, ParseException {
if (valueType == null) {
return null;
}
- HttpEntity entity = response.getEntity();
- Type valueRawType = valueType.getType();
+ final HttpEntity entity = response.getEntity();
+ final Type valueRawType = valueType.getType();
if (valueRawType.equals(byte[].class)) {
return (T) EntityUtils.toByteArray(entity);
- } else if (valueRawType.equals(File.class)) {
- return (T) downloadFileFromResponse(response);
+ } else if (valueRawType.equals(File.class))
+ {
+ return (T)this.downloadFileFromResponse(response);
}
- String mimeType = getResponseMimeType(response);
- if (mimeType == null || isJsonMime(mimeType)) {
+ final String mimeType = this.getResponseMimeType(response);
+ if(mimeType == null || this.isJsonMime(mimeType)) {
// Assume json if no mime type
// convert input stream to string
- String content = EntityUtils.toString(entity);
+ final String content = EntityUtils.toString(entity);
if ("".equals(content)) { // returns null for empty body
return null;
}
-
- return objectMapper.readValue(content, valueType);
+
+ return this.objectMapper.readValue(content, valueType);
} else if (mimeType.toLowerCase().startsWith("text/")) {
// convert input stream to string
return (T) EntityUtils.toString(entity);
- } else {
- Map> responseHeaders = transformResponseHeaders(response.getHeaders());
+ }
+ else
+ {
+ final Map> responseHeaders = this.transformResponseHeaders(response.getHeaders());
throw new ApiException(
"Deserialization for content type '" + mimeType + "' not supported for type '" + valueType + "'",
response.getCode(),
@@ -729,21 +834,22 @@ public T deserialize(CloseableHttpResponse response, TypeReference valueT
);
}
}
-
- protected File downloadFileFromResponse(CloseableHttpResponse response) throws IOException {
- Header contentDispositionHeader = response.getFirstHeader("Content-Disposition");
- String contentDisposition = contentDispositionHeader == null ? null : contentDispositionHeader.getValue();
- File file = prepareDownloadFile(contentDisposition);
+
+ protected File downloadFileFromResponse(final CloseableHttpResponse response) throws IOException
+ {
+ final Header contentDispositionHeader = response.getFirstHeader("Content-Disposition");
+ final String contentDisposition = contentDispositionHeader == null ? null : contentDispositionHeader.getValue();
+ final File file = this.prepareDownloadFile(contentDisposition);
Files.copy(response.getEntity().getContent(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
return file;
}
-
- protected File prepareDownloadFile(String contentDisposition) throws IOException {
+
+ protected File prepareDownloadFile(final String contentDisposition) throws IOException {
String filename = null;
if (contentDisposition != null && !"".equals(contentDisposition)) {
// Get filename from the Content-Disposition header.
- Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
- Matcher matcher = pattern.matcher(contentDisposition);
+ final Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
+ final Matcher matcher = pattern.matcher(contentDisposition);
if (matcher.find())
filename = matcher.group(1);
}
@@ -753,8 +859,10 @@ protected File prepareDownloadFile(String contentDisposition) throws IOException
if (filename == null) {
prefix = "download-";
suffix = "";
- } else {
- int pos = filename.lastIndexOf('.');
+ }
+ else
+ {
+ final int pos = filename.lastIndexOf('.');
if (pos == -1) {
prefix = filename + "-";
} else {
@@ -765,11 +873,13 @@ protected File prepareDownloadFile(String contentDisposition) throws IOException
if (prefix.length() < 3)
prefix = "download-";
}
-
- if (tempFolderPath == null)
+
+ if(this.tempFolderPath == null)
return Files.createTempFile(prefix, suffix).toFile();
else
- return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();
+ {
+ return Files.createTempFile(Paths.get(this.tempFolderPath), prefix, suffix).toFile();
+ }
}
/**
@@ -777,18 +887,22 @@ protected File prepareDownloadFile(String contentDisposition) throws IOException
*
* @return The URL for the client.
*/
- public String getBaseURL() {
- String baseURL;
- if (serverIndex != null) {
- if (serverIndex < 0 || serverIndex >= servers.size()) {
+ public String getBaseURL()
+ {
+ final String baseURL;
+ if(this.serverIndex != null)
+ {
+ if(this.serverIndex < 0 || this.serverIndex >= this.servers.size()) {
throw new ArrayIndexOutOfBoundsException(String.format(
java.util.Locale.ROOT,
- "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size()
+ "Invalid index %d when selecting the host settings. Must be less than %d", this.serverIndex, this.servers.size()
));
}
- baseURL = servers.get(serverIndex).URL(serverVariables);
- } else {
- baseURL = basePath;
+ baseURL = this.servers.get(this.serverIndex).URL(this.serverVariables);
+ }
+ else
+ {
+ baseURL = this.basePath;
}
return baseURL;
}
@@ -802,8 +916,13 @@ public String getBaseURL() {
* @param urlQueryDeepObject URL query string of the deep object parameters
* @return The full URL
*/
- protected String buildUrl(String path, List queryParams, List collectionQueryParams, String urlQueryDeepObject) {
- String baseURL = getBaseURL();
+ protected String buildUrl(
+ final String path,
+ final List queryParams,
+ final List collectionQueryParams,
+ final String urlQueryDeepObject)
+ {
+ final String baseURL = this.getBaseURL();
final StringBuilder url = new StringBuilder();
url.append(baseURL).append(path);
@@ -811,7 +930,7 @@ protected String buildUrl(String path, List queryParams, List collec
if (queryParams != null && !queryParams.isEmpty()) {
// support (constant) query string in `path`, e.g. "/posts?draft=1"
String prefix = path.contains("?") ? "&" : "?";
- for (Pair param : queryParams) {
+ for(final Pair param : queryParams) {
if (param.getValue() != null) {
if (prefix != null) {
url.append(prefix);
@@ -819,16 +938,16 @@ protected String buildUrl(String path, List queryParams, List collec
} else {
url.append("&");
}
- String value = parameterToString(param.getValue());
+ final String value = this.parameterToString(param.getValue());
// query parameter value already escaped as part of parameterToPair
- url.append(escapeString(param.getName())).append("=").append(value);
+ url.append(this.escapeString(param.getName())).append("=").append(value);
}
}
}
if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) {
String prefix = url.toString().contains("?") ? "&" : "?";
- for (Pair param : collectionQueryParams) {
+ for(final Pair param : collectionQueryParams) {
if (param.getValue() != null) {
if (prefix != null) {
url.append(prefix);
@@ -836,9 +955,9 @@ protected String buildUrl(String path, List queryParams, List collec
} else {
url.append("&");
}
- String value = parameterToString(param.getValue());
+ final String value = this.parameterToString(param.getValue());
// collection query parameter value already escaped as part of parameterToPairs
- url.append(escapeString(param.getName())).append("=").append(value);
+ url.append(this.escapeString(param.getName())).append("=").append(value);
}
}
}
@@ -850,36 +969,41 @@ protected String buildUrl(String path, List queryParams, List collec
return url.toString();
}
-
- protected boolean isSuccessfulStatus(int statusCode) {
+
+ protected boolean isSuccessfulStatus(final int statusCode) {
return statusCode >= 200 && statusCode < 300;
}
-
- protected boolean isBodyAllowed(String method) {
+
+ protected boolean isBodyAllowed(final String method) {
return bodyMethods.contains(method);
}
-
- protected Cookie buildCookie(String key, String value, URI uri) {
- BasicClientCookie cookie = new BasicClientCookie(key, value);
+
+ protected Cookie buildCookie(final String key, final String value, final URI uri)
+ {
+ final BasicClientCookie cookie = new BasicClientCookie(key, value);
cookie.setDomain(uri.getHost());
cookie.setPath("/");
return cookie;
}
-
- protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException, ParseException {
- int statusCode = response.getCode();
- lastStatusCode.set(statusCode);
+
+ protected T processResponse(final CloseableHttpResponse response, final TypeReference returnType)
+ throws ApiException, IOException, ParseException
+ {
+ final int statusCode = response.getCode();
+ this.lastStatusCode.set(statusCode);
if (statusCode == HttpStatus.SC_NO_CONTENT) {
return null;
}
-
- Map> responseHeaders = transformResponseHeaders(response.getHeaders());
- lastResponseHeaders.set(responseHeaders);
-
- if (isSuccessfulStatus(statusCode)) {
+
+ final Map> responseHeaders = this.transformResponseHeaders(response.getHeaders());
+ this.lastResponseHeaders.set(responseHeaders);
+
+ if(this.isSuccessfulStatus(statusCode)) {
return this.deserialize(response, returnType);
- } else {
- String message = EntityUtils.toString(response.getEntity());
+ }
+ else
+ {
+ final String message = EntityUtils.toString(response.getEntity());
throw new ApiException(message, statusCode, responseHeaders, message);
}
}
@@ -905,59 +1029,81 @@ protected T processResponse(CloseableHttpResponse response, TypeReference
* @throws ApiException API exception
*/
public T invokeAPI(
- String path,
- String method,
- List queryParams,
- List collectionQueryParams,
- String urlQueryDeepObject,
- Object body,
- Map headerParams,
- Map cookieParams,
- Map formParams,
- String accept,
- String contentType,
- String[] authNames,
- TypeReference returnType) throws ApiException {
+ final String path,
+ final String method,
+ final List queryParams,
+ final List collectionQueryParams,
+ final String urlQueryDeepObject,
+ final Object body,
+ final Map headerParams,
+ final Map cookieParams,
+ final Map formParams,
+ final String accept,
+ final String contentType,
+ final String[] authNames,
+ final TypeReference returnType) throws ApiException {
if (body != null && !formParams.isEmpty()) {
throw new ApiException("Cannot have body and form params");
}
-
- updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
- final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject);
-
- ClassicRequestBuilder builder = ClassicRequestBuilder.create(method);
+
+ this.updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
+ final String url = this.buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject);
+
+ final ClassicRequestBuilder builder = ClassicRequestBuilder.create(method);
builder.setUri(url);
if (accept != null) {
builder.addHeader("Accept", accept);
}
- for (Entry keyValue : headerParams.entrySet()) {
+ for(final Entry keyValue : headerParams.entrySet()) {
builder.addHeader(keyValue.getKey(), keyValue.getValue());
- }
- for (Map.Entry keyValue : defaultHeaderMap.entrySet()) {
+ }
+ for(final Map.Entry keyValue : this.defaultHeaderMap.entrySet()) {
if (!headerParams.containsKey(keyValue.getKey())) {
builder.addHeader(keyValue.getKey(), keyValue.getValue());
}
- }
-
- BasicCookieStore store = new BasicCookieStore();
- for (Entry keyValue : cookieParams.entrySet()) {
- store.addCookie(buildCookie(keyValue.getKey(), keyValue.getValue(), builder.getUri()));
- }
- for (Entry keyValue : defaultCookieMap.entrySet()) {
- if (!cookieParams.containsKey(keyValue.getKey())) {
- store.addCookie(buildCookie(keyValue.getKey(), keyValue.getValue(), builder.getUri()));
+ }
+
+ final BasicCookieStore store = new BasicCookieStore();
+ for(final Entry keyValue : cookieParams.entrySet())
+ {
+ store.addCookie(this.buildCookie(keyValue.getKey(), keyValue.getValue(), builder.getUri()));
+ }
+ for(final Entry keyValue : this.defaultCookieMap.entrySet()) {
+ if (!cookieParams.containsKey(keyValue.getKey()))
+ {
+ store.addCookie(this.buildCookie(keyValue.getKey(), keyValue.getValue(), builder.getUri()));
}
- }
-
- HttpClientContext context = HttpClientContext.create();
+ }
+
+ final HttpClientContext context = HttpClientContext.create();
context.setCookieStore(store);
-
- ContentType contentTypeObj = getContentType(contentType);
- if (body != null || !formParams.isEmpty()) {
- if (isBodyAllowed(method)) {
+
+ if(this.connectionTimeout > 0 || this.readTimeout > 0)
+ {
+ // start from the default request configuration of the underlying HTTP client, if
+ // accessible, so that only the configured timeouts are overridden
+ final RequestConfig defaultConfig =
+ this.httpClient instanceof Configurable ? ((Configurable)this.httpClient).getConfig() : null;
+ final RequestConfig.Builder requestConfigBuilder =
+ defaultConfig == null ? RequestConfig.custom() : RequestConfig.copy(defaultConfig);
+ if(this.connectionTimeout > 0)
+ {
+ requestConfigBuilder.setConnectTimeout(Timeout.ofMilliseconds(this.connectionTimeout));
+ }
+ if(this.readTimeout > 0)
+ {
+ requestConfigBuilder.setResponseTimeout(Timeout.ofMilliseconds(this.readTimeout));
+ }
+ context.setRequestConfig(requestConfigBuilder.build());
+ }
+
+ final ContentType contentTypeObj = this.getContentType(contentType);
+ if (body != null || !formParams.isEmpty())
+ {
+ if(this.isBodyAllowed(method)) {
// Add entity if we have content and a valid method
- builder.setEntity(serialize(body, formParams, contentTypeObj));
+ builder.setEntity(this.serialize(body, formParams, contentTypeObj));
} else {
throw new ApiException("method " + method + " does not support a request body");
}
@@ -965,10 +1111,12 @@ public T invokeAPI(
// for empty body
builder.setEntity(new StringEntity("", contentTypeObj));
}
-
- try (CloseableHttpResponse response = httpClient.execute(builder.build(), context)) {
- return processResponse(response, returnType);
- } catch (IOException | ParseException e) {
+
+ try(final CloseableHttpResponse response = this.httpClient.execute(builder.build(), context))
+ {
+ return this.processResponse(response, returnType);
+ }
+ catch(final IOException | ParseException e) {
throw new ApiException(e);
}
}
@@ -981,9 +1129,15 @@ public T invokeAPI(
* @param headerParams Header parameters
* @param cookieParams Cookie parameters
*/
- protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) {
- for (String authName : authNames) {
- Authentication auth = authentications.get(authName);
+ protected void updateParamsForAuth(
+ final String[] authNames,
+ final List queryParams,
+ final Map headerParams,
+ final Map cookieParams)
+ {
+ for(final String authName : authNames)
+ {
+ final Authentication auth = this.authentications.get(authName);
if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
auth.applyToParams(queryParams, headerParams, cookieParams);
}
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/BaseApi.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/BaseApi.java
index 8842ebb2..74d138ee 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/BaseApi.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/BaseApi.java
@@ -12,7 +12,7 @@
package software.xdev.sessionize.client;
-import com.fasterxml.jackson.core.type.TypeReference;
+import tools.jackson.core.type.TypeReference;
import java.util.Collections;
import java.util.Map;
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339DateFormat.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339DateFormat.java
index f0f22434..0c8f6e85 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339DateFormat.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339DateFormat.java
@@ -12,8 +12,6 @@
package software.xdev.sessionize.client;
-import com.fasterxml.jackson.databind.util.StdDateFormat;
-
import java.text.DateFormat;
import java.text.FieldPosition;
import java.text.ParsePosition;
@@ -21,6 +19,7 @@
import java.text.DecimalFormat;
import java.util.GregorianCalendar;
import java.util.TimeZone;
+import tools.jackson.databind.util.StdDateFormat;
public class RFC3339DateFormat extends DateFormat {
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339InstantDeserializer.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339InstantDeserializer.java
index 1b3b9df9..ce7cfbd6 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339InstantDeserializer.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339InstantDeserializer.java
@@ -12,7 +12,6 @@
package software.xdev.sessionize.client;
-import java.io.IOException;
import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneId;
@@ -23,15 +22,16 @@
import java.util.function.BiFunction;
import java.util.function.Function;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature;
-import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
+import tools.jackson.core.JacksonException;
+import tools.jackson.core.JsonParser;
+import tools.jackson.databind.DeserializationContext;
+import tools.jackson.databind.cfg.DateTimeFeature;
+import tools.jackson.databind.ext.javatime.deser.InstantDeserializer;
public class RFC3339InstantDeserializer extends InstantDeserializer {
- private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault();
+ private final static boolean DEFAULT_NORMALIZE_ZONE_ID = DateTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault();
private final static boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS
- = JavaTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault();
+ = DateTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault();
public static final RFC3339InstantDeserializer INSTANT = new RFC3339InstantDeserializer<>(
Instant.class, DateTimeFormatter.ISO_INSTANT,
@@ -92,7 +92,7 @@ protected RFC3339InstantDeserializer(
}
@Override
- protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) throws IOException {
+ protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) throws JacksonException {
return super._fromString(p, ctxt, string0.replace( ' ', 'T' ));
}
}
\ No newline at end of file
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339JavaTimeModule.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339JavaTimeModule.java
index cec4e8bb..f77b66e3 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339JavaTimeModule.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/client/RFC3339JavaTimeModule.java
@@ -16,21 +16,15 @@
import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import com.fasterxml.jackson.databind.Module.SetupContext;
+import tools.jackson.databind.module.SimpleModule;
public class RFC3339JavaTimeModule extends SimpleModule {
public RFC3339JavaTimeModule() {
super("RFC3339JavaTimeModule");
+ addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT);
+ addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME);
+ addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME);
}
- @Override
- public void setupModule(SetupContext context) {
- super.setupModule(context);
-
- addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT);
- addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME);
- addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME);
- }
}
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/AllResult.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/AllResult.java
index 1fcd8da9..25718838 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/AllResult.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/AllResult.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
@@ -233,6 +232,7 @@ public void setRooms(@jakarta.annotation.Nonnull List rooms) {
this.rooms = rooms;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -272,10 +272,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseCategory.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseCategory.java
index fe7642cf..065600b7 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseCategory.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseCategory.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
@@ -95,6 +94,7 @@ public void setSort(@jakarta.annotation.Nonnull Integer sort) {
this.sort = sort;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -128,10 +128,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSession.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSession.java
index 41eb9170..e0cae9b6 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSession.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSession.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.net.URI;
import java.time.OffsetDateTime;
@@ -437,6 +436,7 @@ public void setStatus(@jakarta.annotation.Nonnull Status status) {
this.status = status;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -501,10 +501,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeaker.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeaker.java
index 4d28a9e5..87b322f7 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeaker.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeaker.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.net.URI;
import java.util.ArrayList;
@@ -339,6 +338,7 @@ public void setFullName(@jakarta.annotation.Nonnull String fullName) {
this.fullName = fullName;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -397,10 +397,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeakerEssential.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeakerEssential.java
index 4320953a..0dc189ea 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeakerEssential.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSpeakerEssential.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@@ -126,6 +125,7 @@ public void setLastName(@jakarta.annotation.Nonnull String lastName) {
this.lastName = lastName;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -161,10 +161,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryAll.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryAll.java
index 92a56087..a85fe50d 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryAll.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryAll.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
@@ -197,6 +196,7 @@ public void setType(@jakarta.annotation.Nonnull String type) {
this.type = type;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -236,10 +236,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItem.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItem.java
index 25b4c7eb..a668ecfe 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItem.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItem.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
@@ -95,6 +94,7 @@ public void setName(@jakarta.annotation.Nonnull String name) {
this.name = name;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -128,10 +128,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItemAll.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItemAll.java
index f136109e..8f8016bb 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItemAll.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategoryItemAll.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
@@ -125,6 +124,7 @@ public void setSort(@jakarta.annotation.Nonnull Integer sort) {
this.sort = sort;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -160,10 +160,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategorySession.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategorySession.java
index 10e9f13c..998caba7 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategorySession.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/CategorySession.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
@@ -167,6 +166,7 @@ public void setCategoryItems(@jakarta.annotation.Nonnull List cate
this.categoryItems = categoryItems;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -204,10 +204,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Link.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Link.java
index e04b3b64..34a19e07 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Link.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Link.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.net.URI;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@@ -126,6 +125,7 @@ public void setLinkType(@jakarta.annotation.Nonnull String linkType) {
this.linkType = linkType;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -161,10 +161,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Question.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Question.java
index 6e1a27a3..162c9c50 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Question.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Question.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
@@ -155,6 +154,7 @@ public void setSort(@jakarta.annotation.Nonnull Integer sort) {
this.sort = sort;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -192,10 +192,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswer.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswer.java
index 65396a17..e9f3b6a5 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswer.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswer.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
@@ -95,6 +94,7 @@ public void setAnswerValue(@jakarta.annotation.Nonnull String answerValue) {
this.answerValue = answerValue;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -128,10 +128,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswerFull.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswerFull.java
index 7e5f46dd..6e066965 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswerFull.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/QuestionAnswerFull.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
@@ -185,6 +184,7 @@ public void setSort(@jakarta.annotation.Nonnull Integer sort) {
this.sort = sort;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -224,10 +224,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Room.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Room.java
index c7d922d6..5c2b4c65 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Room.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Room.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
@@ -125,6 +124,7 @@ public void setSort(@jakarta.annotation.Nonnull Integer sort) {
this.sort = sort;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -160,10 +160,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Session.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Session.java
index 14d1e3d3..4448ac01 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Session.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Session.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.net.URI;
import java.time.OffsetDateTime;
@@ -592,6 +591,7 @@ public void setCategories(@jakarta.annotation.Nonnull List cate
this.categories = categories;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -664,10 +664,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAll.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAll.java
index bc12e0f7..69e34c03 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAll.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionAll.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.net.URI;
import java.time.OffsetDateTime;
@@ -514,6 +513,7 @@ public void setQuestionAnswers(@jakarta.annotation.Nonnull List
this.questionAnswers = questionAnswers;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -582,10 +582,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionGroup.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionGroup.java
index e538b1db..11d68409 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionGroup.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionGroup.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
@@ -167,6 +166,7 @@ public void setIsDefault(@jakarta.annotation.Nullable Boolean isDefault) {
this.isDefault = isDefault;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -204,10 +204,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionMinimal.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionMinimal.java
index 0523786c..cddfccb9 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionMinimal.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SessionMinimal.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
@@ -95,6 +94,7 @@ public void setName(@jakarta.annotation.Nonnull String name) {
this.name = name;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -128,10 +128,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Speaker.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Speaker.java
index 5c074192..fb4abe40 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Speaker.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Speaker.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.net.URI;
import java.util.ArrayList;
@@ -417,6 +416,7 @@ public void setQuestionAnswers(@jakarta.annotation.Nonnull List
this.questionAnswers = questionAnswers;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -478,10 +478,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerMinimal.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerMinimal.java
index 5ee124e6..b4afa202 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerMinimal.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerMinimal.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@@ -96,6 +95,7 @@ public void setName(@jakarta.annotation.Nonnull String name) {
this.name = name;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -129,10 +129,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**
diff --git a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerWithEmail.java b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerWithEmail.java
index 9a55d90e..86f76f86 100644
--- a/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerWithEmail.java
+++ b/sessionize-java-client/src/generated/java/software/xdev/sessionize/model/SpeakerWithEmail.java
@@ -18,7 +18,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@@ -156,6 +155,7 @@ public void setEmail(@jakarta.annotation.Nonnull String email) {
this.email = email;
}
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -193,10 +193,7 @@ public String toString() {
* (except the first line).
*/
private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**