Package com.github.searls.jasmine.config
Class ImmutableServerConfiguration
- java.lang.Object
-
- com.github.searls.jasmine.config.ServerConfiguration
-
- com.github.searls.jasmine.config.ImmutableServerConfiguration
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableServerConfiguration extends ServerConfiguration
Immutable implementation ofServerConfiguration.Use the builder to create immutable instances:
ImmutableServerConfiguration.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableServerConfiguration.BuilderBuilds instances of typeImmutableServerConfiguration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableServerConfiguration.Builderbuilder()Creates a builder forImmutableServerConfiguration.static ImmutableServerConfigurationcopyOf(ServerConfiguration instance)Creates an immutable copy of aServerConfigurationvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableServerConfigurationthat have equal attribute values.StringgetServerHostname()intgetServerPort()StringgetUriScheme()inthashCode()Computes a hash code from attributes:uriScheme,serverHostname,serverPort.StringtoString()Prints the immutable valueServerConfigurationwith attribute values.ImmutableServerConfigurationwithServerHostname(String value)Copy the current immutable object by setting a value for theserverHostnameattribute.ImmutableServerConfigurationwithServerPort(int value)Copy the current immutable object by setting a value for theserverPortattribute.ImmutableServerConfigurationwithUriScheme(String value)Copy the current immutable object by setting a value for theuriSchemeattribute.-
Methods inherited from class com.github.searls.jasmine.config.ServerConfiguration
getServerURL
-
-
-
-
Method Detail
-
getUriScheme
public String getUriScheme()
- Overrides:
getUriSchemein classServerConfiguration- Returns:
- The value of the
uriSchemeattribute
-
getServerHostname
public String getServerHostname()
- Overrides:
getServerHostnamein classServerConfiguration- Returns:
- The value of the
serverHostnameattribute
-
getServerPort
public int getServerPort()
- Overrides:
getServerPortin classServerConfiguration- Returns:
- The value of the
serverPortattribute
-
withUriScheme
public final ImmutableServerConfiguration withUriScheme(String value)
Copy the current immutable object by setting a value for theuriSchemeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for uriScheme- Returns:
- A modified copy of the
thisobject
-
withServerHostname
public final ImmutableServerConfiguration withServerHostname(String value)
Copy the current immutable object by setting a value for theserverHostnameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for serverHostname- Returns:
- A modified copy of the
thisobject
-
withServerPort
public final ImmutableServerConfiguration withServerPort(int value)
Copy the current immutable object by setting a value for theserverPortattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for serverPort- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableServerConfigurationthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:uriScheme,serverHostname,serverPort.
-
toString
public String toString()
Prints the immutable valueServerConfigurationwith attribute values.
-
copyOf
public static ImmutableServerConfiguration copyOf(ServerConfiguration instance)
Creates an immutable copy of aServerConfigurationvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable ServerConfiguration instance
-
builder
public static ImmutableServerConfiguration.Builder builder()
Creates a builder forImmutableServerConfiguration.ImmutableServerConfiguration.builder() .uriScheme(String) // optionaluriScheme.serverHostname(String) // optionalserverHostname.serverPort(int) // optionalserverPort.build();- Returns:
- A new ImmutableServerConfiguration builder
-
-