Class Context
- java.lang.Object
-
- com.anaptecs.jeaf.junit.openapi.base.Context
-
- All Implemented Interfaces:
com.anaptecs.jeaf.core.api.ServiceObject,java.io.Serializable
- Direct Known Subclasses:
SpecialContext
@Valid public class Context extends java.lang.Object implements com.anaptecs.jeaf.core.api.ServiceObject- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContext.BuilderClass implements builder to create a new instance of classContext.
-
Constructor Summary
Constructors Modifier Constructor Description protectedContext()Default constructor is only intended to be used for deserialization by tools like Jackson for JSON.protectedContext(Context.Builder pBuilder)Initialize object using the passed builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCustomHeader(java.lang.String pHeaderName, java.lang.String pHeaderValue)Method adds the passed values as custom headers.static Context.Builderbuilder()Method returns a new builder.static Context.Builderbuilder(Context pObject)Method creates a new builder and initialize it with the data from the passed object.static Context.Builderbuilder(java.lang.String pAccessToken, java.util.Locale pLanguage, long pResellerID, long pPathParam, java.lang.String pQueryParam)Method creates a new builder and initializes it with the passed attributes.java.lang.StringgetAccessToken()Method returns attributeaccessToken.java.util.Map<java.lang.String,java.lang.String>getCustomHeaders()Method returns map with all custom headers that were addedjava.util.LocalegetLanguage()Method returns attributelanguage.longgetPathParam()Method returns attributepathParam.java.lang.StringgetQueryParam()Method returns attributequeryParam.longgetResellerID()Method returns attributeresellerID.voidsetAccessToken(java.lang.String pAccessToken)Method sets attributeaccessToken.voidsetLanguage(java.util.Locale pLanguage)Method sets attributelanguage.voidsetPathParam(long pPathParam)Method sets attributepathParam.voidsetQueryParam(java.lang.String pQueryParam)Method sets attributequeryParam.voidsetResellerID(long pResellerID)Method sets attributeresellerID.java.lang.StringtoString()Method creates a new String with the values of all attributes of this class.java.lang.StringBuildertoStringBuilder(java.lang.String pIndent)Method returns a StringBuilder that can be used to create a String representation of this object.
-
-
-
Constructor Detail
-
Context
protected Context()
Default constructor is only intended to be used for deserialization by tools like Jackson for JSON. For "normal" object creation builder should be used instead.
-
Context
protected Context(Context.Builder pBuilder)
Initialize object using the passed builder.- Parameters:
pBuilder- Builder that should be used to initialize this object. The parameter must not be null.
-
-
Method Detail
-
builder
public static Context.Builder builder()
Method returns a new builder.- Returns:
Context.BuilderNew builder that can be used to create new Context objects.
-
builder
public static Context.Builder builder(Context pObject)
Method creates a new builder and initialize it with the data from the passed object.- Parameters:
pObject- Object that should be used to initialize the builder. The parameter may be null.- Returns:
Context.BuilderNew builder that can be used to create new Context objects. The method never returns null.
-
builder
public static Context.Builder builder(java.lang.String pAccessToken, java.util.Locale pLanguage, long pResellerID, long pPathParam, java.lang.String pQueryParam)
Method creates a new builder and initializes it with the passed attributes.
-
getAccessToken
public java.lang.String getAccessToken()
Method returns attributeaccessToken.- Returns:
StringValue to whichaccessTokenis set.
-
setAccessToken
public void setAccessToken(java.lang.String pAccessToken)
Method sets attributeaccessToken.- Parameters:
pAccessToken- Value to whichaccessTokenshould be set.
-
getLanguage
public java.util.Locale getLanguage()
Method returns attributelanguage.- Returns:
LocaleValue to whichlanguageis set.
-
setLanguage
public void setLanguage(java.util.Locale pLanguage)
Method sets attributelanguage.- Parameters:
pLanguage- Value to whichlanguageshould be set.
-
getResellerID
public long getResellerID()
Method returns attributeresellerID.- Returns:
- long Value to which
resellerIDis set.
-
setResellerID
public void setResellerID(long pResellerID)
Method sets attributeresellerID.- Parameters:
pResellerID- Value to whichresellerIDshould be set.
-
getPathParam
public long getPathParam()
Method returns attributepathParam.- Returns:
- long Value to which
pathParamis set.
-
setPathParam
public void setPathParam(long pPathParam)
Method sets attributepathParam.- Parameters:
pPathParam- Value to whichpathParamshould be set.
-
getQueryParam
public java.lang.String getQueryParam()
Method returns attributequeryParam.- Returns:
StringValue to whichqueryParamis set.
-
setQueryParam
public void setQueryParam(java.lang.String pQueryParam)
Method sets attributequeryParam.- Parameters:
pQueryParam- Value to whichqueryParamshould be set.
-
getCustomHeaders
public java.util.Map<java.lang.String,java.lang.String> getCustomHeaders()
Method returns map with all custom headers that were added- Returns:
MapMap with all custom headers. The method never returns null. The returned map is unmodifiable.
-
addCustomHeader
public void addCustomHeader(java.lang.String pHeaderName, java.lang.String pHeaderValue)Method adds the passed values as custom headers. The passed name and value of the http header must be compliant with guidelines about http headers.- Parameters:
pHeaderName- Name of the HTTP header. The parameter must not be null,pHeaderValue- Value of the http header the parameter may be null.
-
toStringBuilder
public java.lang.StringBuilder toStringBuilder(java.lang.String pIndent)
Method returns a StringBuilder that can be used to create a String representation of this object. The returned StringBuilder also takes care about attributes of super classes.- Returns:
StringBuilderStringBuilder representing this object. The method never returns null.
-
toString
public java.lang.String toString()
Method creates a new String with the values of all attributes of this class. All references to other objects will be ignored.- Overrides:
toStringin classjava.lang.Object- Returns:
StringString representation of this object. The method never returns null.
-
-