public abstract class NamedTypedValue<T extends TypeSchema,V> extends Object
| Modifier and Type | Field and Description |
|---|---|
AccessibleSchema |
accessibleSchema
a schema for collecting if the param is accessaible
|
static String |
NOT_NULL_MARK_OBJ_DATE |
| Constructor and Description |
|---|
NamedTypedValue(String name,
T type,
AccessibleSchema accessibleSchema) |
| Modifier and Type | Method and Description |
|---|---|
abstract NamedTypedValue<T,V> |
copyStructure() |
List<String> |
getCandidateReferences() |
List<NamedTypedValue> |
getCandidates() |
ParamDto |
getDto()
get its dto format in order to further handle it with evomastr core
|
String |
getName() |
T |
getType() |
V |
getValue() |
abstract String |
getValueAsJavaString() |
boolean |
isHasDependentCandidates() |
boolean |
isNullable() |
boolean |
isValidInstance(Object instance) |
abstract List<String> |
newAssertionWithJava(int indent,
String responseVarName,
int maxAssertionForDataInCollection)
create assertions with java for response
|
List<String> |
newAssertionWithJava(String responseVarName,
int maxAssertionForDataInCollection) |
abstract Object |
newInstance() |
abstract List<String> |
newInstanceWithJava(boolean isDeclaration,
boolean doesIncludeName,
String variableName,
int indent)
create instances with Java
|
List<String> |
newInstanceWithJava(int indent)
create instances with Java
|
boolean |
sameParam(ParamDto dto)
it is used to find a param schema based on info specified with dto format
|
void |
setCandidateReferences(List<String> candidateReferences) |
void |
setCandidates(List<NamedTypedValue> candidates) |
void |
setHasDependentCandidates(boolean hasDependentCandidates) |
void |
setNullable(boolean nullable) |
void |
setValue(V value) |
abstract void |
setValueBasedOnDto(ParamDto dto)
set value based on dto
the value is basically obtained from evomaster core
|
void |
setValueBasedOnInstance(Object instance)
set value of param schema based on its instance
it is mainly used to parse response
|
protected abstract void |
setValueBasedOnValidInstance(Object instance)
set the value of the param based on instance
compared with [setValueBasedOnInstance], the type of the instance here is evaluated as valid
|
public static final String NOT_NULL_MARK_OBJ_DATE
public final AccessibleSchema accessibleSchema
public NamedTypedValue(String name, T type, AccessibleSchema accessibleSchema)
public boolean isHasDependentCandidates()
public void setHasDependentCandidates(boolean hasDependentCandidates)
public List<NamedTypedValue> getCandidates()
public void setCandidates(List<NamedTypedValue> candidates)
public String getName()
public T getType()
public V getValue()
public abstract Object newInstance() throws ClassNotFoundException
ClassNotFoundExceptionpublic void setValue(V value)
public void setNullable(boolean nullable)
public boolean isNullable()
public ParamDto getDto()
public abstract NamedTypedValue<T,V> copyStructure()
public boolean sameParam(ParamDto dto)
dto - specifies a param to checkpublic abstract void setValueBasedOnDto(ParamDto dto)
dto - contains value info with stringpublic void setValueBasedOnInstance(Object instance)
instance - a java object which is an instance of this param schemaprotected abstract void setValueBasedOnValidInstance(Object instance)
instance - is the instancepublic boolean isValidInstance(Object instance)
instance - a java object which is an instance of this param schemapublic abstract List<String> newInstanceWithJava(boolean isDeclaration, boolean doesIncludeName, String variableName, int indent)
isDeclaration - specifies whether it is used to declare the instance (ie, with type name).doesIncludeName - specifies whether it is required to have the variable name
eg, if true, var = new instance(); if yes, new instance();variableName - specifies the name of variableindent - specifies the indent of this block of the codepublic List<String> newInstanceWithJava(int indent)
indent - specifies the current indent of the codepublic abstract List<String> newAssertionWithJava(int indent, String responseVarName, int maxAssertionForDataInCollection)
indent - specifies the current indent of the coderesponseVarName - a variable name for responsesmaxAssertionForDataInCollection - public List<String> newAssertionWithJava(String responseVarName, int maxAssertionForDataInCollection)
responseVarName - is the variable name of the responsepublic abstract String getValueAsJavaString()
Copyright © 2016–2022. All rights reserved.