Class Identifiers


  • public class Identifiers
    extends Object
    Contains the identifiers used in the guards and properties of the specifications in a OperationSpecification. 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 Detail

      • receiverName

        private final String receiverName
        The receiver name.
      • parameters

        private final List<String> parameters
        The formal parameter names (not including the receiver).
      • returnName

        private final String returnName
        The return value identifier.
    • Constructor Detail

      • Identifiers

        public Identifiers​(String receiverName,
                           List<String> parameters,
                           String returnName)
        Create an Identifiers object with the given names.
        Parameters:
        receiverName - the receiver name
        parameters - the list of identifiers for the operation formal parameters
        returnName - the return name
      • Identifiers

        public Identifiers​(List<String> parameters)
        Create an Identifiers 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 a Identifiers 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 this Identifiers object.
        Returns:
        the receiver name
      • getParameterNames

        public List<String> getParameterNames()
        Returns the parameter names in this Identifiers object.
        Returns:
        the parameter names
      • getReturnName

        public String getReturnName()
        Returns the identifier for the return value in this Identifiers object.
        Returns:
        the return value identifier
      • duplicateName

        public String duplicateName()
        Returns an identifier name that occurs more than once in this Identifiers, or null if there are no duplicate names.
        Returns:
        a name occurs more than once, or null if there are no duplicate names
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object