Record Class Api
java.lang.Object
java.lang.Record
com.google.errorprone.bugpatterns.checkreturnvalue.Api
- Record Components:
className- Returns the fully qualified type that contains the given method/constructor.methodName- Returns the simple name of the method. If the API is a constructor (i.e.,isConstructor() == true), then"<init>"is returned.parameterTypes- Returns the list of fully qualified parameter types for the given method/constructor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclassNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themethodNamerecord component.com.google.common.collect.ImmutableList<String> Returns the value of theparameterTypesrecord component.static ApiParses an API string into anApi, ignoring trailing or inner whitespace between names.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Api
public Api(String className, String methodName, com.google.common.collect.ImmutableList<String> parameterTypes) Creates an instance of aApirecord class.- Parameters:
className- the value for theclassNamerecord componentmethodName- the value for themethodNamerecord componentparameterTypes- the value for theparameterTypesrecord component
-
-
Method Details
-
toString
-
parse
Parses an API string into anApi, ignoring trailing or inner whitespace between names.Example API strings are:
- a constructor (e.g.,
java.net.URI#<init>(java.lang.String)) - a static method (e.g.,
java.net.URI#create(java.lang.String)) - an instance method (e.g.,
java.util.List#get(int)) - an instance method with types erased (e.g.,
java.util.List#add(java.lang.Object))
- Throws:
IllegalArgumentException- whenapiis not well-formed
- a constructor (e.g.,
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
className
-
methodName
Returns the value of themethodNamerecord component.- Returns:
- the value of the
methodNamerecord component
-
parameterTypes
Returns the value of theparameterTypesrecord component.- Returns:
- the value of the
parameterTypesrecord component
-