com.alibaba.dashscope.threads.AnnotationBase Maven / Gradle / Ivy
package com.alibaba.dashscope.threads;
import com.alibaba.dashscope.common.TypeRegistry;
import com.google.gson.annotations.SerializedName;
public class AnnotationBase {
/**
* End Index
*
* (Required)
*/
@SerializedName("end_index")
private Integer endIndex;
/**
* Start Index
*
*
(Required)
*/
@SerializedName("start_index")
private Integer startIndex;
/**
* Text
*
*
(Required)
*/
@SerializedName("text")
private String text;
/**
* Type
*
*
(Required)
*/
@SerializedName("type")
private Object type;
private static final TypeRegistry annotationRegistry = new TypeRegistry<>();
protected static synchronized void registerAnnotation(
String type, Class extends AnnotationBase> clazz) {
annotationRegistry.register(type, clazz);
}
public static synchronized Class extends AnnotationBase> getAnnotationClass(String type) {
return annotationRegistry.get(type);
}
// register official tools for list.
static {
registerAnnotation("file_citation", FileCitationAnnotation.class);
registerAnnotation("file_path", FilePathAnnotation.class);
}
}