com.opdar.gulosity.connection.entity.Column Maven / Gradle / Ivy
The newest version!
package com.opdar.gulosity.connection.entity;
/**
* Payload
* lenenc_str catalog
* lenenc_str schema
* lenenc_str table
* lenenc_str org_table
* lenenc_str name
* lenenc_str org_name
* lenenc_int length of fixed-length fields [0c]
* 2 character set
* 4 column length
* 1 type
* 2 flags
* 1 decimals
* 2 filler [00] [00]
* if command was COM_FIELD_LIST {
* lenenc_int length of default-values
* string[$len] default values
* }
* Created by Shey on 2016/8/21.
*/
public class Column {
private String catalog;
private String schema;
private String table;
private String orgTable;
private String name;
private String orgName;
private long length;
private int characterSet;
private long columnLength;
private byte type;
private int flags;
private byte decimals;
private int filler;
private String definition;
public long getLength() {
return length;
}
public void setLength(long length) {
this.length = length;
}
public String getCatalog() {
return catalog;
}
public void setCatalog(String catalog) {
this.catalog = catalog;
}
public String getSchema() {
return schema;
}
public void setSchema(String schema) {
this.schema = schema;
}
public String getTable() {
return table;
}
public void setTable(String table) {
this.table = table;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getOrgTable() {
return orgTable;
}
public void setOrgTable(String orgTable) {
this.orgTable = orgTable;
}
public String getOrgName() {
return orgName;
}
public void setOrgName(String orgName) {
this.orgName = orgName;
}
public int getCharacterSet() {
return characterSet;
}
public void setCharacterSet(int characterSet) {
this.characterSet = characterSet;
}
public long getColumnLength() {
return columnLength;
}
public void setColumnLength(long columnLength) {
this.columnLength = columnLength;
}
public byte getType() {
return type;
}
public void setType(byte type) {
this.type = type;
}
public int getFlags() {
return flags;
}
public void setFlags(int flags) {
this.flags = flags;
}
public byte getDecimals() {
return decimals;
}
public void setDecimals(byte decimals) {
this.decimals = decimals;
}
public int getFiller() {
return filler;
}
public void setFiller(int filler) {
this.filler = filler;
}
public String getDefinition() {
return definition;
}
public void setDefinition(String definition) {
this.definition = definition;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if(o instanceof String){
return getName().equals(o);
}
if (o == null || getClass() != o.getClass()) return false;
Column column = (Column) o;
return name.equals(column.name);
}
@Override
public int hashCode() {
return name.hashCode();
}
@Override
public String toString() {
return getName();
}
}