algoliasearch.config.AgentSegment.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of algoliasearch-scala_3 Show documentation
Show all versions of algoliasearch-scala_3 Show documentation
Scala client for Algolia Search API
package algoliasearch.config
/** Represents a segment of algolia agent header.
* @param value
* segment string value
* @param version
* optional version
*/
case class AgentSegment(value: String, version: Option[String] = None) {
override def toString: String = version match {
case Some(ver) => s"$value ($ver)"
case None => s"$value"
}
}
object AgentSegment {
/** Creates a new AgentSegment instance with the given value and version. */
def apply(value: String, version: String): AgentSegment = new AgentSegment(value, Some(version))
/** Creates a new AgentSegment instance with the given value. */
def apply(value: String): AgentSegment = new AgentSegment(value)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy