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

net.dongliu.prettypb.runtime.include.ProtoField Maven / Gradle / Ivy

There is a newer version: 0.3.2
Show newest version
package net.dongliu.prettypb.runtime.include;

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

/**
 * used to mark a bean's field as proto filed.
 *
 * @author dongliu
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface ProtoField {
    /**
     * the proto field's name; empty if same with the java field name
     */
    String value() default "";

    /**
     * the proto field index.
     *
     * @return
     */
    int idx();

    /**
     * if this field has been deprecated
     *
     * @return
     */
    boolean deprecated() default false;

    /**
     * if this field is marked as required
     *
     * @return
     */
    boolean required() default false;

    /**
     * if the field is repeated
     *
     * @return
     */
    boolean repeated() default false;

    /**
     * the field type
     *
     * @return
     */
    ProtoType type();

    /**
     * if this field has default value
     * @return
     */
    boolean hasDefault() default false;

    /**
     * if list is encoded as packed. only for primitive num type
     *
     * @return
     */
    boolean packed() default false;

    /**
     * this is ignored now
     * @return
     */
    boolean lazy() default false;

    /**
     * the proto field name
     * @return
     */
    String name();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy