-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use strategy common extends versionspecific
- Loading branch information
Martijn Hoekstra
committed
Oct 20, 2019
1 parent
de48cd9
commit 92d7d3e
Showing
17 changed files
with
141 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...le-base-http/src/main/scala-2.12-/com/twitter/finagle/http/CookieMapVersionSpecific.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
package com.twitter.finagle.http | ||
|
||
import scala.collection.mutable.Builder | ||
import scala.collection.mutable.MapLike | ||
|
||
protected abstract class CookieMapVersionSpecific(message: Message, cookieCodec: CookieCodec) { | ||
def this(message: Message) = this(message, CookieMap.cookieCodec) | ||
|
||
def addCookie(cookie: (String, Cookie)): this.type | ||
def addCookies(cookies: TraversableOnce[(String, Cookie)]): this.type | ||
def removeCookie(name: String): this.type | ||
def removeCookies(names: TraversableOnce[String]): this.type | ||
|
||
def +=(cookie: (String, Cookie)): this.type = addCookie(cookie) | ||
def -=(name: String): this.type = removeCookie(name) | ||
} |
12 changes: 12 additions & 0 deletions
12
...gle-base-http/src/main/scala-2.12-/com/twitter/finagle/http/ParamMapVersionSpecific.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
package com.twitter.finagle.http | ||
|
||
import scala.collection.mutable.MapLike | ||
|
||
protected trait ParamMapVersionSpecific { | ||
def setParam[B >: String](kv: (String, B)): ParamMap | ||
def +[V1 >: String](kv: (String, V1)): ParamMap = setParam(kv._1, kv._2) | ||
|
||
def clearParam(name: String): ParamMap | ||
def -(name: String): ParamMap = clearParam(name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...http/src/main/scala-2.12-/com/twitter/finagle/http/headers/HeaderMapVersionSpecific.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.twitter.finagle.http | ||
|
||
import com.twitter.finagle.http.headers.Header | ||
import scala.collection.mutable | ||
|
||
protected abstract class HeaderMapVersionSpecific { | ||
def set(name: String, header: String): this.type | ||
def removeHeader(name: String): this.type | ||
|
||
def -=(key: String): this.type = removeHeader(key) | ||
def +=(kv: (String, String)): this.type = set(kv._1, kv._2) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...le-base-http/src/main/scala-2.13+/com/twitter/finagle/http/CookieMapVersionSpecific.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.twitter.finagle.http | ||
|
||
import scala.collection.IterableOnce | ||
|
||
protected abstract class CookieMapVersionSpecific(message: Message, cookieCodec: CookieCodec) { | ||
def this(message: Message) = this(message, CookieMap.cookieCodec) | ||
|
||
def addCookie(cookie: (String, Cookie)): this.type | ||
def addCookies(cookies: IterableOnce[(String, Cookie)]): this.type | ||
def removeCookie(name: String): this.type | ||
def removeCookies(names: IterableOnce[String]): this.type | ||
|
||
def addOne(cookie: (String, Cookie)): this.type = addCookie(cookie) | ||
def subtractOne(name: String): this.type = removeCookie(name) | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...gle-base-http/src/main/scala-2.13+/com/twitter/finagle/http/ParamMapVersionSpecific.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
package com.twitter.finagle.http | ||
|
||
protected abstract class ParamMapVersionSpecific { | ||
def setParam[B >: String](kv: (String, B)): ParamMap | ||
def updated[V1 >: String](key: String, value: V1): ParamMap = setParam(key, value) | ||
def +[V1 >: String](key: String, value: V1): ParamMap = setParam(key, value) | ||
|
||
def clearParam(name: String): ParamMap | ||
def removed(name: String): ParamMap = clearParam(name) | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...http/src/main/scala-2.13+/com/twitter/finagle/http/headers/HeaderMapVersionSpecific.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.twitter.finagle.http | ||
|
||
import com.twitter.finagle.http.headers.Header | ||
import scala.collection.mutable | ||
|
||
protected abstract class HeaderMapVersionSpecific { | ||
def set(name: String, header: String): this.type | ||
def removeHeader(name: String): this.type | ||
|
||
def subtractOne(key: String): this.type = removeHeader(key) | ||
def addOne(kv: (String, String)): this.type = set(kv._1, kv._2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.