All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.minlessika.membership.integration.JsTax Maven / Gradle / Ivy

Go to download

It's a library to help developers to integration membership services to another project.

There is a newer version: 0.3.1
Show newest version
package com.minlessika.membership.integration;

import java.util.UUID;
import javax.json.JsonObject;

public class JsTax implements Tax {

    private final JsonObject json ;

    public JsTax(final JsonObject json) {
        this.json = json;
    }

    @Override
    public UUID uid() {
        return UUID.fromString(this.json.getString("id"));
    }

    @Override
    public String name() {
        return this.json.getString("name");
    }

    @Override
    public String shortName() {
        return this.json.getString("shortName");
    }

    @Override
    public double value() {
        return this.json.getJsonNumber("value").doubleValue();
    }

    @Override
    public NumberValueType valueType() {
        return NumberValueType.get(this.json.getInt("valueTypeId"));
    }

    @Override
    public TaxType type() {
        return TaxType.get(this.json.getInt("typeId"));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy