=htc #20920 create ContentLength HTTP header in JavaDSL (#20926)

remove constructor
This commit is contained in:
Nafer Sanabria 2016-07-18 03:55:09 -05:00 committed by Konrad Malawski
parent a75c3f7bf1
commit 8047f3359f
2 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1,13 @@
/**
* Copyright (C) 2016 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.http.javadsl.model.headers;
/**
* Model for the `Content-Length` header.
* Specification: https://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-26#section-3.3.2
*/
public abstract class ContentLength extends akka.http.scaladsl.model.HttpHeader {
public abstract long length();
}

View file

@ -377,7 +377,8 @@ object `Content-Length` extends ModeledCompanion[`Content-Length`]
* Instances of this class will only be created transiently during header parsing and will never appear * Instances of this class will only be created transiently during header parsing and will never appear
* in HttpMessage.header. To access the Content-Length, see subclasses of HttpEntity. * in HttpMessage.header. To access the Content-Length, see subclasses of HttpEntity.
*/ */
final case class `Content-Length` private[http] (length: Long) extends RequestResponseHeader { final case class `Content-Length` private[http] (length: Long) extends jm.headers.ContentLength
with RequestResponseHeader {
def renderValue[R <: Rendering](r: R): r.type = r ~~ length def renderValue[R <: Rendering](r: R): r.type = r ~~ length
protected def companion = `Content-Length` protected def companion = `Content-Length`
} }