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 accessible
|
protected static com.fasterxml.jackson.databind.ObjectMapper |
objectMaper |
| Constructor and Description |
|---|
NamedTypedValue(String name,
T type,
AccessibleSchema accessibleSchema) |
| Modifier and Type | Method and Description |
|---|---|
void |
copyProperties(NamedTypedValue copy) |
abstract NamedTypedValue<T,V> |
copyStructure() |
NamedTypedValue<T,V> |
copyStructureWithProperties() |
List<String> |
getCandidateReferences() |
List<NamedTypedValue> |
getCandidates() |
NamedTypedValue |
getDefaultValue() |
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 isJava) |
boolean |
isHasDependentCandidates() |
boolean |
isMutable() |
boolean |
isNullable() |
boolean |
isValidInstance(Object instance) |
abstract List<String> |
newAssertionWithJavaOrKotlin(int indent,
String responseVarName,
int maxAssertionForDataInCollection,
boolean isJava)
create assertions with java for response
|
List<String> |
newAssertionWithJavaOrKotlin(String responseVarName,
int maxAssertionForDataInCollection,
boolean isJava) |
abstract Object |
newInstance() |
abstract List<String> |
newInstanceWithJavaOrKotlin(boolean isDeclaration,
boolean doesIncludeName,
String variableName,
int indent,
boolean isJava,
boolean isVariableNullable)
create instances with Java
|
List<String> |
newInstanceWithJavaOrKotlin(int indent,
boolean isJava,
boolean isVariableNullable)
create instances with Java
|
Object |
parseValueWithJson(String json) |
abstract List<String> |
referenceTypes() |
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 |
setDefaultValue(NamedTypedValue defaultValue) |
void |
setHasDependentCandidates(boolean hasDependentCandidates) |
void |
setMutable(boolean mutable) |
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
|
void |
setValueBasedOnInstanceOrJson(Object json)
set value based on json
|
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
|
protected static final com.fasterxml.jackson.databind.ObjectMapper objectMaper
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 NamedTypedValue<T,V> copyStructureWithProperties()
public abstract NamedTypedValue<T,V> copyStructure()
public void copyProperties(NamedTypedValue copy)
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 schemapublic void setValueBasedOnInstanceOrJson(Object json) throws com.fasterxml.jackson.core.JsonProcessingException
json - contains value info with json formatcom.fasterxml.jackson.core.JsonProcessingExceptionpublic Object parseValueWithJson(String json) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionprotected 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> newInstanceWithJavaOrKotlin(boolean isDeclaration, boolean doesIncludeName, String variableName, int indent, boolean isJava, boolean isVariableNullable)
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 codeisJava - isVariableNullable - public List<String> newInstanceWithJavaOrKotlin(int indent, boolean isJava, boolean isVariableNullable)
indent - specifies the current indent of the codeisJava - isVariableNullable - public abstract List<String> newAssertionWithJavaOrKotlin(int indent, String responseVarName, int maxAssertionForDataInCollection, boolean isJava)
indent - specifies the current indent of the coderesponseVarName - a variable name for responsesmaxAssertionForDataInCollection - isJava - public List<String> newAssertionWithJavaOrKotlin(String responseVarName, int maxAssertionForDataInCollection, boolean isJava)
responseVarName - is the variable name of the responseisJava - public abstract String getValueAsJavaString(boolean isJava)
public boolean isMutable()
public void setMutable(boolean mutable)
public NamedTypedValue getDefaultValue()
public void setDefaultValue(NamedTypedValue defaultValue)
Copyright © 2016–2023. All rights reserved.