Package net.officefloor.server.http
Class HttpVersion
- java.lang.Object
-
- net.officefloor.server.http.HttpVersion
-
- All Implemented Interfaces:
java.io.Serializable
public class HttpVersion extends java.lang.Object implements java.io.Serializable
HTTP version.- Author:
- Daniel Sagenschneider
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpVersion.HttpVersionEnum
HttpVersion
Enum
for common HTTP methods.
-
Field Summary
Fields Modifier and Type Field Description static HttpVersion
HTTP_1_0
HttpVersion
1.0.static HttpVersion
HTTP_1_1
HttpVersion
1.1.
-
Constructor Summary
Constructors Constructor Description HttpVersion(java.lang.String name)
Instantiate a dynamicHttpVersion
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
HttpVersion.HttpVersionEnum
getEnum()
Obtains theHttpVersion.HttpVersionEnum
for thisHttpVersion
.static HttpVersion
getHttpVersion(java.lang.String version)
Obtains theHttpVersion
.java.lang.String
getName()
Obtains theHttpVersion
name.int
hashCode()
boolean
isEqual(HttpVersion httpMethod)
Equals without the type checking.java.lang.String
toString()
<B> void
write(StreamBuffer<B> head, StreamBufferPool<B> bufferPool)
Writes thisHttpStatus
to theStreamBuffer
.
-
-
-
Field Detail
-
HTTP_1_0
public static HttpVersion HTTP_1_0
HttpVersion
1.0.
-
HTTP_1_1
public static HttpVersion HTTP_1_1
HttpVersion
1.1.
-
-
Constructor Detail
-
HttpVersion
public HttpVersion(java.lang.String name)
Instantiate a dynamicHttpVersion
.- Parameters:
name
- Name of theHttpVersion
.
-
-
Method Detail
-
getHttpVersion
public static HttpVersion getHttpVersion(java.lang.String version)
Obtains theHttpVersion
.- Parameters:
version
-HttpVersion
.- Returns:
HttpVersion
.
-
isEqual
public boolean isEqual(HttpVersion httpMethod)
Equals without the type checking.- Parameters:
httpMethod
-HttpVersion
.- Returns:
true
if sameHttpVersion
.
-
getEnum
public HttpVersion.HttpVersionEnum getEnum()
Obtains theHttpVersion.HttpVersionEnum
for thisHttpVersion
.- Returns:
HttpVersion.HttpVersionEnum
.
-
getName
public java.lang.String getName()
Obtains theHttpVersion
name.- Returns:
HttpVersion
name.
-
write
public <B> void write(StreamBuffer<B> head, StreamBufferPool<B> bufferPool)
Writes thisHttpStatus
to theStreamBuffer
.- Type Parameters:
B
- Buffer type.- Parameters:
head
- HeadStreamBuffer
of the linked list ofStreamBuffer
instances.bufferPool
-StreamBufferPool
.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-