oracle中有enum类型码,一个经典的枚举值类型(数据库类型 Type类)
一个经典的枚举值类型(数据库类型 Type类)2020年01月27日阅读数:19这篇文章主要向大家介绍一个经典的枚举值类型(数据库类型 Type类),主要内容包括基础应用、实用技巧、原理机制等方面,希望对大家有所帮助。/*** Protobuf enum {@code com.alibaba.otter.canal.protocol.Type}** * *数据库类型** */public enum
一个经典的枚举值类型(数据库类型 Type类)
2020年01月27日
阅读数:19
这篇文章主要向大家介绍一个经典的枚举值类型(数据库类型 Type类),主要内容包括基础应用、实用技巧、原理机制等方面,希望对大家有所帮助。
/**
* Protobuf enum {@code com.alibaba.otter.canal.protocol.Type}
*
*
* *数据库类型*
*
*/
public enum Type implements com.google.protobuf.ProtocolMessageEnum {
/**
* ORACLE = 1;
*/
ORACLE(0, 1),
/**
* MYSQL = 2;
*/
MYSQL(1, 2),
/**
* PGSQL = 3;
*/
PGSQL(2, 3), ;
/**
* ORACLE = 1;
*/
public static final int ORACLE_VALUE = 1;
/**
* MYSQL = 2;
*/
public static final int MYSQL_VALUE = 2;
/**
* PGSQL = 3;
*/
public static final int PGSQL_VALUE = 3;
public final int getNumber() {
return value;
}
public static Type valueOf(int value) {
switch (value) {
case 1:
return ORACLE;
case 2:
return MYSQL;
case 3:
return PGSQL;
default:
return null;
}
}
private final int index;
private final int value;
private Type(int index, int value){
this.index = index;
this.value = value;
}
}
更多推荐
所有评论(0)