代码@TypeConverterAnnotation是什么意思?

下面的代码是从一个网页,我不明白的代码@TypeConverterAnnotation是什么意思?

这只是一个注释,我可以删除代码吗?

package mobi.porquenao.poc.kotlin.core import com.raizlabs.android.dbflow.converter.TypeConverter import java.util.* import com.raizlabs.android.dbflow.annotation.TypeConverter as TypeConverterAnnotation @TypeConverterAnnotation class CalendarConverter : TypeConverter<Long, Calendar>() { override fun getDBValue(model: Calendar): Long? { return model.timeInMillis } override fun getModelValue(data: Long?): Calendar { val calendar = Calendar.getInstance() calendar.timeInMillis = data!! return calendar } } 

是的,这只是 DBFlow项目的一个注释:

 /** * Author: andrewgrosner * Description: Marks a class as being a TypeConverter. * A type converter will turn a non-model, non-SQLiteTyped class into * a valid database type. */ @Retention(RetentionPolicy.CLASS) @Target(ElementType.TYPE) public @interface TypeConverter { /** * @return Specify a set of subclasses by which the {@link TypeConverter} * registers for. For each one, this will create a new instance of the converter. */ Class<?>[] allowedSubtypes() default {}; } 

我们如何知道你的代码是否需要它? 🙂