All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.driver.mapping.AliasedMappedProperty Maven / Gradle / Ivy

There is a newer version: 4.15.102
Show newest version
/*
 * Copyright DataStax, Inc.
 *
 * This software can be used solely with DataStax Enterprise. Please consult the license at
 * http://www.datastax.com/terms/datastax-dse-driver-license-terms
 */
package com.datastax.driver.mapping;

class AliasedMappedProperty implements Comparable {

  final MappedProperty mappedProperty;
  final String alias;

  @SuppressWarnings("unchecked")
  AliasedMappedProperty(MappedProperty mappedProperty, String alias) {
    this.mappedProperty = (MappedProperty) mappedProperty;
    this.alias = alias;
  }

  @Override
  public int compareTo(AliasedMappedProperty that) {
    String thisColName = mappedProperty.getMappedName();
    String thatColName = that.mappedProperty.getMappedName();
    return thisColName.compareTo(thatColName);
  }
}