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

com.devsisters.shardcake.PodAddress.scala Maven / Gradle / Ivy

The newest version!
package com.devsisters.shardcake

import scala.collection.compat._

case class PodAddress(host: String, port: Int) {
  override def toString: String = s"$host:$port"
}

object PodAddress {
  def apply(s: String): Option[PodAddress] =
    s.split(':').toList match {
      case host :: port :: Nil => port.toIntOption.map(port => PodAddress(host, port))
      case _                   => None
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy