java.lang.Object
com.hedera.hashgraph.sdk.Endpoint
- All Implemented Interfaces:
Cloneable
Utility class used internally by the sdk.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) byte[](package private) String(package private) int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()(package private) static EndpointfromProtobuf(ServiceEndpoint serviceEndpoint) Create an endpoint object from a service endpoint protobuf.byte[]Extract the ipv4 address.Extract the domain name.intgetPort()Extract the port number.setAddress(byte[] address) Assign the ipv4 address.setDomainName(String domainName) Assign the desired domain name.setPort(int port) Assign the desired port number.(package private) ServiceEndpointCreate the protobuf.toString()static voidvalidateNoIpAndDomain(Endpoint endpoint) Validate that the endpoint does not contain both an IP address and a domain name.
-
Field Details
-
address
@Nullable byte[] address -
port
int port -
domainName
String domainName
-
-
Constructor Details
-
Endpoint
public Endpoint()Constructor.
-
-
Method Details
-
fromProtobuf
Create an endpoint object from a service endpoint protobuf.- Parameters:
serviceEndpoint- the service endpoint protobuf- Returns:
- the endpoint object
-
getAddress
@Nullable public byte[] getAddress()Extract the ipv4 address.- Returns:
- the ipv4 address
-
setAddress
Assign the ipv4 address.- Parameters:
address- the desired ipv4 address- Returns:
this
-
getPort
public int getPort()Extract the port number.- Returns:
- the port number
-
setPort
Assign the desired port number.- Parameters:
port- the desired port number- Returns:
this
-
getDomainName
Extract the domain name.- Returns:
- the domain name
-
setDomainName
Assign the desired domain name.- Parameters:
domainName- the desired domain name- Returns:
this
-
validateNoIpAndDomain
Validate that the endpoint does not contain both an IP address and a domain name.- Parameters:
endpoint- the endpoint to validate- Throws:
IllegalArgumentException- if both ipAddressV4 and domainName are present
-
toProtobuf
ServiceEndpoint toProtobuf()Create the protobuf.- Returns:
- the protobuf representation
-
toString
-
clone
-