Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Java, adds schema classes #274

Merged
merged 15 commits into from
Nov 7, 2023
Merged

Java, adds schema classes #274

merged 15 commits into from
Nov 7, 2023

Conversation

spacether
Copy link
Contributor

@spacether spacether commented Nov 7, 2023

  • Adds and uses FormatValidator
  • Adds these schemas
    • NullSchema
    • BooleanSchema
    • NumberSchema
    • FormatValidator
    • Int64Schema
    • Int32Schema
    • DoubleSchema
    • FloatSchema

Java context for integer and floating pt numeric types
floating:

  • 4 bytes - float
  • 8 bytes - double

integer:

  • 4 bytes - int
  • 8 bytes - long

type number - Long + Double (cast Integer and Float into these) or optionally use BigDecimal to ensure that both can be held. Otherwise return type is Object.
type integer - Integer, Long, Float, Double (Long accessor)
type number format int32: Integer, Float [Not long/double] (Integer accessor)
type number format int64: Integer, Float, Long, Double (Long accessor)
type number format float: Float [not Double] (Float accessor)
type number format double: Double (Double accessor)

Plan

  • Store all numeric types as BigDecimal, this ensures that type number can return BigDecimal
  • schema validate converts types back to needed Long/Integer/Float/Double to mirror object property access
  • The XSchema.validate method and the TypeValidator will validate type
  • The FormatValidator will validate bounds

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    mvn clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/python*.
    For Windows users, please run the script in Git BASH.

@spacether spacether merged commit 53fabbd into master Nov 7, 2023
@spacether spacether deleted the feat_adds_schema_classes branch November 7, 2023 07:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant