| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableNet.Builder
Builds instances of type
ImmutableNet. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableNet.Builder |
builder()
Creates a builder for
ImmutableNet. |
static ImmutableNet |
copyOf(Net instance)
Creates an immutable copy of a
Net value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableNet that have equal attribute values. |
Optional<String> |
getBindIp() |
int |
getPort() |
int |
hashCode()
Computes a hash code from attributes:
bindIp, port, isIpv6. |
boolean |
isIpv6() |
String |
toString()
Prints the immutable value
Net with attribute values. |
ImmutableNet |
withBindIp(Optional<String> optional)
Copy the current immutable object by setting an optional value for the
bindIp attribute. |
ImmutableNet |
withBindIp(String value)
Copy the current immutable object by setting a present value for the optional
bindIp attribute. |
ImmutableNet |
withIsIpv6(boolean value)
Copy the current immutable object by setting a value for the
isIpv6 attribute. |
ImmutableNet |
withPort(int value)
Copy the current immutable object by setting a value for the
port attribute. |
defaults, getServerAddress, ofpublic int getPort()
public boolean isIpv6()
public final ImmutableNet withBindIp(String value)
bindIp attribute.value - The value for bindIpthis objectpublic final ImmutableNet withBindIp(Optional<String> optional)
bindIp attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for bindIpthis objectpublic final ImmutableNet withPort(int value)
port attribute.
A value equality check is used to prevent copying of the same value by returning this.public final ImmutableNet withIsIpv6(boolean value)
isIpv6 attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for isIpv6this objectpublic boolean equals(Object another)
ImmutableNet that have equal attribute values.public int hashCode()
bindIp, port, isIpv6.public String toString()
Net with attribute values.public static ImmutableNet copyOf(Net instance)
Net value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static ImmutableNet.Builder builder()
ImmutableNet.
ImmutableNet.builder()
.bindIp(String) // optional bindIp
.port(int) // required port
.isIpv6(boolean) // required isIpv6
.build();
Copyright © 2024. All rights reserved.