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

com.raynigon.unit_api.jackson.annotation.JsonUnit Maven / Gradle / Ivy

There is a newer version: 1.1.7
Show newest version
package com.raynigon.unit_api.jackson.annotation;

import com.raynigon.unit_api.core.annotation.QuantityShape;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;

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

    /**
     * AliasFor(value="unit")
     * Specifies the unit in which the Quantity is serialized/deserialized
     * @return the unit which should be used for serialization/deserialization
     */
    String value() default "";

    /**
     * Specifies the unit in which the Quantity is serialized/deserialized
     * @return the unit which should be used for serialization/deserialization
     */
    String unit() default "";

    /**
     * Serialize the Quantity as String
     * @return the shape which should be used for serialization/deserialization
     */
    QuantityShape shape() default QuantityShape.NUMBER;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy