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

scray.common.key.StringKey.scala Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
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