Package randoop.condition.specification
Class Identifiers
- java.lang.Object
-
- randoop.condition.specification.Identifiers
-
public class Identifiers extends Object
Contains the identifiers used in the guards and properties of the specifications in aOperationSpecification
. The order of the names is significant, but the names need not match the actual declaration of the method.The JSON serialization of this class is used to read the specifications for an operation given using the
--specifications
command-line option. The JSON should include a JSON object labeled by the name of each field of this class, as in{ "receiverName": "receiver", "parameters": [ "signalValue" ], "returnName": "result" }
Names for the receiver and return value are optional; they default to "receiver" and "result".
-
-
Field Summary
Fields Modifier and Type Field Description private List<String>
parameters
The formal parameter names (not including the receiver).private String
receiverName
The receiver name.private String
returnName
The return value identifier.
-
Constructor Summary
Constructors Constructor Description Identifiers()
Create aIdentifiers
object with no parameters and the default identifiers for the receiver and return value.Identifiers(String receiverName, List<String> parameters, String returnName)
Create anIdentifiers
object with the given names.Identifiers(List<String> parameters)
Create anIdentifiers
object with the given parameter names and the default identifiers for the receiver and return value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
duplicateName()
Returns an identifier name that occurs more than once in thisIdentifiers
, or null if there are no duplicate names.boolean
equals(Object object)
List<String>
getParameterNames()
Returns the parameter names in thisIdentifiers
object.String
getReceiverName()
Returns the identifier for the receiver object in thisIdentifiers
object.String
getReturnName()
Returns the identifier for the return value in thisIdentifiers
object.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
Identifiers
public Identifiers(String receiverName, List<String> parameters, String returnName)
Create anIdentifiers
object with the given names.- Parameters:
receiverName
- the receiver nameparameters
- the list of identifiers for the operation formal parametersreturnName
- the return name
-
Identifiers
public Identifiers(List<String> parameters)
Create anIdentifiers
object with the given parameter names and the default identifiers for the receiver and return value.- Parameters:
parameters
- the list of identifiers for the operation parameters
-
Identifiers
public Identifiers()
Create aIdentifiers
object with no parameters and the default identifiers for the receiver and return value.
-
-
Method Detail
-
getReceiverName
public String getReceiverName()
Returns the identifier for the receiver object in thisIdentifiers
object.- Returns:
- the receiver name
-
getParameterNames
public List<String> getParameterNames()
Returns the parameter names in thisIdentifiers
object.- Returns:
- the parameter names
-
getReturnName
public String getReturnName()
Returns the identifier for the return value in thisIdentifiers
object.- Returns:
- the return value identifier
-
duplicateName
public String duplicateName()
Returns an identifier name that occurs more than once in thisIdentifiers
, or null if there are no duplicate names.- Returns:
- a name occurs more than once, or null if there are no duplicate names
-
-