Class PrimitiveOrWrapperParam<V>
java.lang.Object
org.evomaster.client.java.controller.problem.rpc.schema.params.NamedTypedValue<PrimitiveOrWrapperType,V>
org.evomaster.client.java.controller.problem.rpc.schema.params.PrimitiveOrWrapperParam<V>
- All Implemented Interfaces:
NumericConstraintBase<BigDecimal>
- Direct Known Subclasses:
BooleanParam,ByteParam,CharParam,DoubleParam,FloatParam,IntParam,LongParam,ShortParam
public abstract class PrimitiveOrWrapperParam<V>
extends NamedTypedValue<PrimitiveOrWrapperType,V>
implements NumericConstraintBase<BigDecimal>
Primitive types Param
-
Field Summary
Fields inherited from class org.evomaster.client.java.controller.problem.rpc.schema.params.NamedTypedValue
accessibleSchema, mapperAllowUnkownFields, objectMaper -
Constructor Summary
ConstructorsConstructorDescriptionPrimitiveOrWrapperParam(String name, String type, String fullTypeName, Class<?> clazz, AccessibleSchema accessibleSchema, JavaDtoSpec spec) PrimitiveOrWrapperParam(String name, PrimitiveOrWrapperType type, AccessibleSchema accessibleSchema) -
Method Summary
Modifier and TypeMethodDescriptionstatic PrimitiveOrWrapperParambuild(String name, Class<?> clazz, AccessibleSchema accessibleSchema, JavaDtoSpec spec) castValueInTestGenerationIfNeeded(String stringValue, boolean isJava) booleancastValueWithSpecificMethod(boolean isJava) convertValueTo(Object value) voidgetDto()get its dto format in order to further handle it with evomastr coregetMax()booleangetMin()booleanstatic TypegetPrimitiveOrWrapper(Type type) setter might not use exact same type for primitive typegetPrimitiveValueInAssertion(String responseVarName, boolean isJava) getScale()newAssertionWithJavaOrKotlin(int indent, String responseVarName, int maxAssertionForDataInCollection, boolean isJava) create assertions with java for responsenewInstanceWithJavaOrKotlin(boolean isDeclaration, boolean doesIncludeName, String variableName, int indent, boolean isJava, boolean isVariableNullable) create instances with Javaabstract StringprimitiveValueMethod(boolean isJava) voidsetMax(BigDecimal max) voidsetMaxInclusive(boolean inclusive) voidsetMin(BigDecimal min) voidsetMinInclusive(boolean inclusive) voidsetPrecision(Integer precision) voidvoidset value based on dto the value is basically obtained from evomaster coreabstract voidsetValueBasedOnStringValue(String stringValue) Methods inherited from class org.evomaster.client.java.controller.problem.rpc.schema.params.NamedTypedValue
copyStructure, copyStructureWithProperties, getCandidateReferences, getCandidates, getDefaultValue, getName, getType, getValue, getValueAsJavaString, isHasDependentCandidates, isMutable, isNullable, isValidInstance, newAssertionWithJavaOrKotlin, newInstanceWithJavaOrKotlin, parseValueWithJson, sameParam, setCandidateReferences, setCandidates, setDefaultValue, setHasDependentCandidates, setMutable, setNullable, setValue, setValueBasedOnInstance, setValueBasedOnInstanceOrJson, setValueBasedOnValidInstanceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.evomaster.client.java.controller.problem.rpc.schema.params.NumericConstraintBase
handleConstraintsInCopy, handleConstraintsInCopyDto
-
Constructor Details
-
PrimitiveOrWrapperParam
public PrimitiveOrWrapperParam(String name, String type, String fullTypeName, Class<?> clazz, AccessibleSchema accessibleSchema, JavaDtoSpec spec) -
PrimitiveOrWrapperParam
public PrimitiveOrWrapperParam(String name, PrimitiveOrWrapperType type, AccessibleSchema accessibleSchema)
-
-
Method Details
-
build
public static PrimitiveOrWrapperParam build(String name, Class<?> clazz, AccessibleSchema accessibleSchema, JavaDtoSpec spec) -
getPrimitiveOrWrapper
setter might not use exact same type for primitive type- Parameters:
type-- Returns:
-
getDto
Description copied from class:NamedTypedValueget its dto format in order to further handle it with evomastr core- Overrides:
getDtoin classNamedTypedValue<PrimitiveOrWrapperType,V> - Returns:
- its corresponding dto
-
getMin
- Specified by:
getMinin interfaceNumericConstraintBase<V>
-
setMin
- Specified by:
setMinin interfaceNumericConstraintBase<V>
-
getMax
- Specified by:
getMaxin interfaceNumericConstraintBase<V>
-
setMax
- Specified by:
setMaxin interfaceNumericConstraintBase<V>
-
newInstance
- Specified by:
newInstancein classNamedTypedValue<PrimitiveOrWrapperType,V>
-
newInstanceWithJavaOrKotlin
public List<String> newInstanceWithJavaOrKotlin(boolean isDeclaration, boolean doesIncludeName, String variableName, int indent, boolean isJava, boolean isVariableNullable) Description copied from class:NamedTypedValuecreate instances with Java- Specified by:
newInstanceWithJavaOrKotlinin classNamedTypedValue<PrimitiveOrWrapperType,V> - 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 code- Returns:
- a list of string which could create instance with java
-
newAssertionWithJavaOrKotlin
public List<String> newAssertionWithJavaOrKotlin(int indent, String responseVarName, int maxAssertionForDataInCollection, boolean isJava) Description copied from class:NamedTypedValuecreate assertions with java for response- Specified by:
newAssertionWithJavaOrKotlinin classNamedTypedValue<PrimitiveOrWrapperType,V> - Parameters:
indent- specifies the current indent of the coderesponseVarName- a variable name for responses- Returns:
- a list of string for assertions
-
setValueBasedOnDto
Description copied from class:NamedTypedValueset value based on dto the value is basically obtained from evomaster core- Specified by:
setValueBasedOnDtoin classNamedTypedValue<PrimitiveOrWrapperType,V> - Parameters:
dto- contains value info with string
-
convertValueTo
-
setValueBasedOnStringValue
-
getPrimitiveValueInAssertion
- Parameters:
responseVarName- refers to the variable name in responseisJava-- Returns:
- a string to get its primitive value if the param is Wrapper class eg, res.byteValue() for byte with a response variable name res
-
copyProperties
- Overrides:
copyPropertiesin classNamedTypedValue<PrimitiveOrWrapperType,V>
-
castValueWithSpecificMethod
public boolean castValueWithSpecificMethod(boolean isJava) -
castValueInTestGenerationIfNeeded
-
getCastType
- Returns:
- a cast type for this param, null means that there is no need to cast the value to a type
-
getMinInclusive
public boolean getMinInclusive()- Specified by:
getMinInclusivein interfaceNumericConstraintBase<V>
-
setMinInclusive
public void setMinInclusive(boolean inclusive) - Specified by:
setMinInclusivein interfaceNumericConstraintBase<V>
-
getMaxInclusive
public boolean getMaxInclusive()- Specified by:
getMaxInclusivein interfaceNumericConstraintBase<V>
-
setMaxInclusive
public void setMaxInclusive(boolean inclusive) - Specified by:
setMaxInclusivein interfaceNumericConstraintBase<V>
-
getPrecision
- Specified by:
getPrecisionin interfaceNumericConstraintBase<V>
-
setPrecision
- Specified by:
setPrecisionin interfaceNumericConstraintBase<V>
-
getScale
- Specified by:
getScalein interfaceNumericConstraintBase<V>
-
setScale
- Specified by:
setScalein interfaceNumericConstraintBase<V>
-
referenceTypes
- Specified by:
referenceTypesin classNamedTypedValue<PrimitiveOrWrapperType,V>
-
primitiveValueMethod
-