@Override public int compareTo(AbstractThriftBase other) { if (!getClass().equals(other.getClass())) return getClass().getName().compareTo(other.getClass().getName()); int lastComparison = Boolean.valueOf(isSet(null)).compareTo(isSet(null)); if (lastComparison != 0) return lastComparison; if (isSet(null)) { lastComparison = TBaseHelper.compareTo(str, other.getStr()); if (lastComparison != 0) return lastComparison; } return 0; }
public int compareTo(MockMessage other) { if(!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; MockMessage typedOther = (MockMessage) other; lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName()); if(lastComparison != 0) { return lastComparison; } if(isSetName()) { lastComparison = TBaseHelper.compareTo(this.name, typedOther.name); if(lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMappings()).compareTo(typedOther.isSetMappings()); if(lastComparison != 0) { return lastComparison; } if(isSetMappings()) { lastComparison = TBaseHelper.compareTo(this.mappings, typedOther.mappings); if(lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIntList()).compareTo(typedOther.isSetIntList()); if(lastComparison != 0) { return lastComparison; } if(isSetIntList()) { lastComparison = TBaseHelper.compareTo(this.intList, typedOther.intList); if(lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetStrSet()).compareTo(typedOther.isSetStrSet()); if(lastComparison != 0) { return lastComparison; } if(isSetStrSet()) { lastComparison = TBaseHelper.compareTo(this.strSet, typedOther.strSet); if(lastComparison != 0) { return lastComparison; } } return 0; }
/** * Converts column name into byte[] according to comparator type * @param column - column name from parser * @param columnFamily - column family name from parser * @return bytes[] - into which column name was converted according to comparator type */ private byte[] columnNameAsByteArray(String column, String columnFamily) { return TBaseHelper.byteBufferToByteArray(columnNameAsBytes(column, columnFamily)); }
/** * Converts column name into byte[] according to comparator type * @param column - column name from parser * @param cfDef - column family from parser * @return bytes[] - into which column name was converted according to comparator type */ private byte[] columnNameAsByteArray(String column, CfDef cfDef) { return TBaseHelper.byteBufferToByteArray(columnNameAsBytes(column, cfDef)); }
/** * Converts sub-column name into byte[] according to comparator type * @param superColumn - sub-column name from parser * @param cfDef - column family from parser * @return bytes[] - into which column name was converted according to comparator type */ private byte[] subColumnNameAsByteArray(String superColumn, CfDef cfDef) { return TBaseHelper.byteBufferToByteArray(subColumnNameAsBytes(superColumn, cfDef)); }