public class Identifiers
extends java.lang.Object
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".
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
parameters
The formal parameter names (not including the receiver).
|
private java.lang.String |
receiverName
The receiver name.
|
private java.lang.String |
returnName
The return value identifier.
|
Constructor and Description |
---|
Identifiers()
Create a
Identifiers object with no parameters and the default identifiers for the
receiver and return value. |
Identifiers(java.util.List<java.lang.String> parameters)
Create an
Identifiers object with the given parameter names and the default identifiers
for the receiver and return value. |
Identifiers(java.lang.String receiverName,
java.util.List<java.lang.String> parameters,
java.lang.String returnName)
Create an
Identifiers object with the given names. |
Modifier and Type | Method and Description |
---|---|
@Nullable java.lang.String |
duplicateName()
Returns an identifier name that occurs more than once in this
Identifiers , or null if
there are no duplicate names. |
boolean |
equals(@Nullable java.lang.Object object) |
java.util.List<java.lang.String> |
getParameterNames()
Returns the parameter names in this
Identifiers object. |
java.lang.String |
getReceiverName()
Returns the identifier for the receiver object in this
Identifiers object. |
java.lang.String |
getReturnName()
Returns the identifier for the return value in this
Identifiers object. |
int |
hashCode() |
java.lang.String |
toString() |
private final java.lang.String receiverName
private final java.util.List<java.lang.String> parameters
private final java.lang.String returnName
public Identifiers(java.lang.String receiverName, java.util.List<java.lang.String> parameters, java.lang.String returnName)
Identifiers
object with the given names.receiverName
- the receiver nameparameters
- the list of identifiers for the operation formal parametersreturnName
- the return namepublic Identifiers(java.util.List<java.lang.String> parameters)
Identifiers
object with the given parameter names and the default identifiers
for the receiver and return value.parameters
- the list of identifiers for the operation parameterspublic Identifiers()
Identifiers
object with no parameters and the default identifiers for the
receiver and return value.public java.lang.String getReceiverName()
Identifiers
object.public java.util.List<java.lang.String> getParameterNames()
Identifiers
object.public java.lang.String getReturnName()
Identifiers
object.public @Nullable java.lang.String duplicateName()
Identifiers
, or null if
there are no duplicate names.public boolean equals(@Nullable java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object