scray.common.key.StringKey.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scray-querying Show documentation
Show all versions of scray-querying Show documentation
query engine core source code
package scray.common.key
import scray.common.key.api.ScrayKey
import scray.common.key.api.KeyGenerator
class StringKey(value: String, version: Float = 1.0f) extends ScrayKey(value, version) with Serializable {
val key = value
def getKeyAsString: String = {
key
}
override def equals(that: Any): Boolean = {
that match {
case that: OrderedStringKey => {
that.getKeyAsString == this.getKeyAsString && that.version == this.version
}
case _ => false
}
}
override def hashCode: Int = {
return key.hashCode()
}
}
object StringKey extends KeyGenerator[String] {
def apply(value: String, version: Float = 1.0f): StringKey = {
new StringKey(value, version)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy