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

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

The newest version!
package net.dongliu.prettypb.runtime.include;

import java.util.List;
import java.util.Map;

/**
 * for proto message which have extensions
 *
 * @author Dong Liu
 */
public interface Extendable {

    /**
     * all the extension this message defined
     * this is for internal use
     *
     * @return the extension ranges
     */
    List getExtensionRangeList();

    /**
     * if extension ranges contains this tag
     * this is for internal use
     *
     * @return true or false
     */
    boolean tagInExtensions(int tag);

    /**
     * if this message have the extension
     *
     * @return true or false
     */
     boolean hasExtension(ExtensionField field);

    /**
     * get the extension value
     *
     * @param field not null
     * @return extension by field. it not exists, return null
     */
     T getExtension(ExtensionField field);

    /**
     * get all extensions have been set
     *
     * @return all existed extensions
     */
    Map getAllExtensions();

    /**
     * set the extension value
     *
     * @param field not null
     * @param value the field's value
     */
     void setExtension(ExtensionField field, T value);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy