Code Monkey home page Code Monkey logo

unit-api's People

Contributors

codacy-badger avatar dependabot[bot] avatar mergify[bot] avatar raynigon avatar raynigon-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unit-api's Issues

Custom Quantity Parser & Serializer

Is your feature request related to a problem? Please describe.
I want to parse quantities like "1cm", "5m/s" etc.

Describe the solution you'd like
It would be nice to have the ability to pass custom parser/serializers with the annotation.

Describe alternatives you've considered
Make if possible to parse the given quantities by default.

Additional context

Support for Array Types

Is your feature request related to a problem? Please describe.
I'm always frustrated when using Quantity Arrays in PostgreSQL

Describe the solution you'd like

    @Column(name = "elevations", nullable = false)
    private Quantity<Length>[] elevations

Describe alternatives you've considered
Converting the Quantity Array to a double Array.

Additional context

Replace JsonUnit/JpaUnit value types with Class<Unit>

We want to use the Unit classes for the JsonUnit/JpaUnit Annotations.
This should prevent misspelling (at runtime), due to compiler checks.

Aceptance Criteria

  • JsonUnit value property type is Class<Unit>
  • JsonUnit unit property type is Class<Unit>
  • JpaUnit value property type is Class<Unit>
  • JpaUnit unit property type is Class<Unit>
  • All occurences of the String Unit specification gets replaced by the class definition

Serialize/Deserialize Quantities as Objects

Is your feature request related to a problem? Please describe.
I would like to Serialize/Deserialize Quantities as Objects

Describe the solution you'd like
I would like to Serialize/Deserialize Quantities as Objects

Describe alternatives you've considered

Document Type Descriptor for JPA Usage

It has come to my attention, that the JPA Usage description is not good enough.

It was not clear for some users, to use the type descriptor annotation for their entity.
This should be improved.

Handle Unit Type in Jackson & JPA

Is your feature request related to a problem? Please describe.
I'm always frustrated when i need to store a Unit in the Database.

Describe the solution you'd like
Handle the Unit type similar to Quantities

Describe alternatives you've considered

Additional context

Missing Jar Archive

Describe the bug
Since Version 1.1.3 a jar archive with not claffisier is no longer available in maven.

Absolute Quantities Converter

Is your feature request related to a problem? Please describe.
I'm always frustrated when i have to deal with negative Quantities.
Example: Metre(-12.0) < Metre(11.0)

Describe the solution you'd like
It would be nice to have an absolute value converter.
Metre(-12.0).abs() < Metre(11.0)

Describe alternatives you've considered
Currently i use something like:

Quantity<Length> x = Metre(-12.0)
if ((x < Metre(0.0) && x < Metre(-11.0)) || (x > Metre(0.0) && x > Metre(11.0)) {
    ...
}

For the Kotlin Part of my Code i used this extension function:

fun <T : Quantity<T>> Quantity<T>.abs(): Quantity<T> {
    if (this.value.toDouble() < 0)
        return this * -1.0
    return this
}

Convert Duration to Time Quantity and around

Provide Extension Methods for the Time Quantity to convert it to a duration and the other way around.

val duration = Duration.ofSeconds(10)
val quantity = duration.toQuantity()
val result = quantity.toDuration()

JsonQuantityReader Annotation is not available during runtime

Describe the bug
JsonQuantityReader Annotation is broken and not covered by test cases.

To Reproduce

  1. use the JsonQuantityReader
  2. It will not work

Expected behavior

@Target({METHOD, FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface JsonQuantityReader {

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.