Class NamedTypedValue<T extends TypeSchema,V>
java.lang.Object
org.evomaster.client.java.controller.problem.rpc.schema.params.NamedTypedValue<T,V>
- Direct Known Subclasses:
BigDecimalParam,BigIntegerParam,ByteBufferParam,CollectionParam,DateParam,EnumParam,MapParam,ObjectParam,PairParam,PrimitiveOrWrapperParam,Protobuf3ByteStringParam,StringParam
a named instance of the type with its value, eg Param/Field
it could be a request param or a response
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AccessibleSchemaa schema for collecting if the param is accessibleprotected static final com.fasterxml.jackson.databind.ObjectMapperprotected static final com.fasterxml.jackson.databind.ObjectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabstract NamedTypedValue<T,V> org.evomaster.client.java.controller.api.dto.problem.rpc.ParamDtogetDto()get its dto format in order to further handle it with evomastr coregetName()getType()getValue()abstract StringgetValueAsJavaString(boolean isJava) booleanbooleanbooleanbooleanisValidInstance(Object instance) newAssertionWithJavaOrKotlin(int indent, String responseVarName, int maxAssertionForDataInCollection, boolean isJava) create assertions with java for responsenewAssertionWithJavaOrKotlin(String responseVarName, int maxAssertionForDataInCollection, boolean isJava) abstract ObjectnewInstanceWithJavaOrKotlin(boolean isDeclaration, boolean doesIncludeName, String variableName, int indent, boolean isJava, boolean isVariableNullable) create instances with JavanewInstanceWithJavaOrKotlin(int indent, boolean isJava, boolean isVariableNullable) create instances with JavaparseValueWithJson(String json) booleansameParam(org.evomaster.client.java.controller.api.dto.problem.rpc.ParamDto dto) it is used to find a param schema based on info specified with dto formatvoidsetCandidateReferences(List<String> candidateReferences) voidsetCandidates(List<NamedTypedValue> candidates) voidsetDefaultValue(NamedTypedValue defaultValue) voidsetHasDependentCandidates(boolean hasDependentCandidates) voidsetMutable(boolean mutable) voidsetNullable(boolean nullable) voidabstract voidsetValueBasedOnDto(org.evomaster.client.java.controller.api.dto.problem.rpc.ParamDto dto) set value based on dto the value is basically obtained from evomaster corevoidsetValueBasedOnInstance(Object instance) set value of param schema based on its instance it is mainly used to parse responsevoidset value based on jsonprotected abstract voidsetValueBasedOnValidInstance(Object instance) set the value of the param based on instance compared with [setValueBasedOnInstance], the type of the instance here is evaluated as valid
-
Field Details
-
objectMaper
protected static final com.fasterxml.jackson.databind.ObjectMapper objectMaper -
mapperAllowUnkownFields
protected static final com.fasterxml.jackson.databind.ObjectMapper mapperAllowUnkownFields -
accessibleSchema
a schema for collecting if the param is accessible
-
-
Constructor Details
-
NamedTypedValue
-
-
Method Details
-
isHasDependentCandidates
public boolean isHasDependentCandidates() -
setHasDependentCandidates
public void setHasDependentCandidates(boolean hasDependentCandidates) -
getCandidates
-
setCandidates
-
getCandidateReferences
-
setCandidateReferences
-
getName
-
getType
-
getValue
-
newInstance
- Throws:
ClassNotFoundException
-
referenceTypes
-
setValue
-
setNullable
public void setNullable(boolean nullable) -
isNullable
public boolean isNullable() -
getDto
public org.evomaster.client.java.controller.api.dto.problem.rpc.ParamDto getDto()get its dto format in order to further handle it with evomastr core- Returns:
- its corresponding dto
-
copyStructureWithProperties
-
copyStructure
-
copyProperties
-
sameParam
public boolean sameParam(org.evomaster.client.java.controller.api.dto.problem.rpc.ParamDto dto) it is used to find a param schema based on info specified with dto format- Parameters:
dto- specifies a param to check- Returns:
- whether [this] param schema info is consistent with the given dto
-
setValueBasedOnDto
public abstract void setValueBasedOnDto(org.evomaster.client.java.controller.api.dto.problem.rpc.ParamDto dto) set value based on dto the value is basically obtained from evomaster core- Parameters:
dto- contains value info with string
-
setValueBasedOnInstance
set value of param schema based on its instance it is mainly used to parse response- Parameters:
instance- a java object which is an instance of this param schema
-
setValueBasedOnInstanceOrJson
public void setValueBasedOnInstanceOrJson(Object json) throws com.fasterxml.jackson.core.JsonProcessingException set value based on json- Parameters:
json- contains value info with json format- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
parseValueWithJson
public Object parseValueWithJson(String json) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
setValueBasedOnValidInstance
set the value of the param based on instance compared with [setValueBasedOnInstance], the type of the instance here is evaluated as valid- Parameters:
instance- is the instance
-
isValidInstance
- Parameters:
instance- a java object which is an instance of this param schema- Returns:
- if the specified instance conforms with this param schema
-
newInstanceWithJavaOrKotlin
public abstract List<String> newInstanceWithJavaOrKotlin(boolean isDeclaration, boolean doesIncludeName, String variableName, int indent, boolean isJava, boolean isVariableNullable) create instances with Java- Parameters:
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-- Returns:
- a list of string which could create instance with java
-
newInstanceWithJavaOrKotlin
public List<String> newInstanceWithJavaOrKotlin(int indent, boolean isJava, boolean isVariableNullable) create instances with Java- Parameters:
indent- specifies the current indent of the codeisJava-isVariableNullable-- Returns:
- a list of string which could create instance with java
-
newAssertionWithJavaOrKotlin
public abstract List<String> newAssertionWithJavaOrKotlin(int indent, String responseVarName, int maxAssertionForDataInCollection, boolean isJava) create assertions with java for response- Parameters:
indent- specifies the current indent of the coderesponseVarName- a variable name for responsesmaxAssertionForDataInCollection-isJava-- Returns:
- a list of string for assertions
-
newAssertionWithJavaOrKotlin
public List<String> newAssertionWithJavaOrKotlin(String responseVarName, int maxAssertionForDataInCollection, boolean isJava) - Parameters:
responseVarName- is the variable name of the responseisJava-- Returns:
- a list of assertions based on this which could be a response
-
getValueAsJavaString
- Returns:
- a string which could representing the value of the param with java eg, float 4.2 could be 4.2f
-
isMutable
public boolean isMutable() -
setMutable
public void setMutable(boolean mutable) -
getDefaultValue
-
setDefaultValue
-