Record Class ServicePortNameAndNumber
java.lang.Object
java.lang.Record
org.springframework.cloud.kubernetes.commons.discovery.ServicePortNameAndNumber
public record ServicePortNameAndNumber(@Nullable Integer portNumber, @Nullable String portName)
extends Record
- Author:
- wind57
-
Constructor Summary
ConstructorsConstructorDescriptionServicePortNameAndNumber(Integer portNumber, String portName) Creates an instance of aServicePortNameAndNumberrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.portName()Returns the value of theportNamerecord component.Returns the value of theportNumberrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ServicePortNameAndNumber
Creates an instance of aServicePortNameAndNumberrecord class.- Parameters:
portNumber- the value for theportNumberrecord componentportName- the value for theportNamerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
portNumber
Returns the value of theportNumberrecord component.- Returns:
- the value of the
portNumberrecord component
-
portName
Returns the value of theportNamerecord component.- Returns:
- the value of the
portNamerecord component
-