Package org.restlet.data
Class Expectation
- java.lang.Object
-
- org.restlet.data.Expectation
-
- All Implemented Interfaces:
NamedValue<java.lang.String>
public final class Expectation extends java.lang.Object implements NamedValue<java.lang.String>
Particular server behavior that is required by a client. Note that when used with HTTP connectors, this class maps to the "Expect" header.- Author:
- Jerome Louvel
-
-
Constructor Summary
Constructors Constructor Description Expectation(java.lang.String name)Constructor for directives with no value.Expectation(java.lang.String name, java.lang.String value)Constructor for directives with a value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExpectationcontinueResponse()Creates a "100-continue" expectation.booleanequals(java.lang.Object obj)java.lang.StringgetName()Returns the name.java.util.List<Parameter>getParameters()Returns the list of parameters.java.lang.StringgetValue()Returns the value.inthashCode()voidsetName(java.lang.String name)Sets the name.voidsetParameters(java.util.List<Parameter> parameters)Sets the list of parameters.voidsetValue(java.lang.String value)Sets the value.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Expectation
public Expectation(java.lang.String name)
Constructor for directives with no value.- Parameters:
name- The directive name.
-
Expectation
public Expectation(java.lang.String name, java.lang.String value)Constructor for directives with a value.- Parameters:
name- The directive name.value- The directive value.
-
-
Method Detail
-
continueResponse
public static Expectation continueResponse()
Creates a "100-continue" expectation. If a client will wait for a 100 (Continue) provisional response before sending the request body, it MUST send this expectation. A client MUST NOT send this expectation if it does not intend to send a request entity.- Returns:
- A new "100-continue" expectation.
- See Also:
- HTTP 1.1 - Expect header
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getName
public java.lang.String getName()
Returns the name.- Specified by:
getNamein interfaceNamedValue<java.lang.String>- Returns:
- The name.
-
getParameters
public java.util.List<Parameter> getParameters()
Returns the list of parameters.- Returns:
- The list of parameters.
-
getValue
public java.lang.String getValue()
Returns the value.- Specified by:
getValuein interfaceNamedValue<java.lang.String>- Returns:
- The value.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
setName
public void setName(java.lang.String name)
Sets the name.- Parameters:
name- The name.
-
setParameters
public void setParameters(java.util.List<Parameter> parameters)
Sets the list of parameters.- Parameters:
parameters- The list of parameters.
-
setValue
public void setValue(java.lang.String value)
Sets the value.- Specified by:
setValuein interfaceNamedValue<java.lang.String>- Parameters:
value- The value.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-