Top Description Inners Fields Constructors Methods
org.apache.http.config

public Class MessageConstraints

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
org.apache.http.util.Args

HTTP Message constraints: line length and header count.

Please note that line length is defined in bytes and not characters. This is only relevant however when using non-standard HTTP charsets for protocol elements such as UTF-8.

Since
4.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final MessageConstraints
private final int
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
MessageConstraints(final int maxLineLength, final int maxHeaderCount)

Method Summary

Modifier and TypeMethod and Description
protected MessageConstraints
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public static MessageConstraints.Builder
copy(final MessageConstraints config)

public static MessageConstraints.Builder
public int
public int
public static MessageConstraints
lineLen(final int max)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DEFAULTback to summary
public static final MessageConstraints DEFAULT
maxHeaderCountback to summary
private final int maxHeaderCount
maxLineLengthback to summary
private final int maxLineLength

Constructor Detail

MessageConstraintsback to summary
pack-priv MessageConstraints(final int maxLineLength, final int maxHeaderCount)

Method Detail

cloneback to summary
protected MessageConstraints clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:MessageConstraints

a clone of this instance.

Annotations
@Override
Exceptions
CloneNotSupportedException:
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
copyback to summary
public static MessageConstraints.Builder copy(final MessageConstraints config)
customback to summary
public static MessageConstraints.Builder custom()
getMaxHeaderCountback to summary
public int getMaxHeaderCount()
getMaxLineLengthback to summary
public int getMaxLineLength()
lineLenback to summary
public static MessageConstraints lineLen(final int max)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.apache.http.config back to summary

public Class MessageConstraints.Builder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private int
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public MessageConstraints
public MessageConstraints.Builder
setMaxHeaderCount(final int maxHeaderCount)

public MessageConstraints.Builder
setMaxLineLength(final int maxLineLength)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

maxHeaderCountback to summary
private int maxHeaderCount
maxLineLengthback to summary
private int maxLineLength

Constructor Detail

Builderback to summary
pack-priv Builder()

Method Detail

buildback to summary
public MessageConstraints build()
setMaxHeaderCountback to summary
public MessageConstraints.Builder setMaxHeaderCount(final int maxHeaderCount)
setMaxLineLengthback to summary
public MessageConstraints.Builder setMaxLineLength(final int maxLineLength)