net.dongliu.prettypb.runtime.include.Extendable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of prettypb-include Show documentation
Show all versions of prettypb-include Show documentation
necessary lib for proto beans compile
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);
}