Package org.apache.maven.api.settings
Class Proxy
java.lang.Object
org.apache.maven.api.settings.TrackableBase
org.apache.maven.api.settings.IdentifiableBase
org.apache.maven.api.settings.Proxy
- All Implemented Interfaces:
Serializable
,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class Proxy
extends IdentifiableBase
implements Serializable, InputLocationTracker
The
<proxy>
element contains information required to a proxy settings.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create Proxy instances. -
Constructor Summary
ModifierConstructorDescriptionprotected
Proxy
(Proxy.Builder builder) Constructor for this class, to be called from its subclasses andProxy.Builder
. -
Method Summary
Modifier and TypeMethodDescriptionWhether this proxy configuration is the active one.getHost()
The proxy host.getLocation
(Object key) Gets the location of the specified field in the input source.Gets the keys of the locations of the input source.The list of non-proxied hosts (delimited by|
).The proxy password.int
getPort()
Returns the port to use for this proxy.The proxy port.The proxy protocol.The proxy user.boolean
isActive()
Indicates if this proxy is active.static Proxy.Builder
Creates a newProxy
builder instance.static Proxy.Builder
newBuilder
(boolean withDefaults) Creates a newProxy
builder instance using default values or not.static Proxy.Builder
newBuilder
(Proxy from) Creates a newProxy
builder instance using the specified object as a basis.static Proxy.Builder
newBuilder
(Proxy from, boolean forceCopy) Creates a newProxy
builder instance using the specified object as a basis.static Proxy
Creates a newProxy
instance.static Proxy
newInstance
(boolean withDefaults) Creates a newProxy
instance using default values or not.with()
Creates a new builder with this object as the basis.withActiveString
(String activeString) Creates a newProxy
instance using the specified activeString.Creates a newProxy
instance using the specified host.Creates a newProxy
instance using the specified id.withNonProxyHosts
(String nonProxyHosts) Creates a newProxy
instance using the specified nonProxyHosts.withPassword
(String password) Creates a newProxy
instance using the specified password.withPortString
(String portString) Creates a newProxy
instance using the specified portString.withProtocol
(String protocol) Creates a newProxy
instance using the specified protocol.withUsername
(String username) Creates a newProxy
instance using the specified username.Methods inherited from class org.apache.maven.api.settings.IdentifiableBase
getId, newBuilder, newBuilder
Methods inherited from class org.apache.maven.api.settings.TrackableBase
getImportedFrom, newBuilder, newBuilder
-
Constructor Details
-
Proxy
Constructor for this class, to be called from its subclasses andProxy.Builder
.- See Also:
-
-
Method Details
-
getActiveString
Whether this proxy configuration is the active one. Note: While the type of this field isString
for technical reasons, the semantic type is actuallyboolean
.- Returns:
- a
String
- See Also:
-
getProtocol
The proxy protocol.- Returns:
- a
String
-
getUsername
The proxy user.- Returns:
- a
String
-
getPassword
The proxy password.- Returns:
- a
String
-
getPortString
The proxy port. Note: While the type of this field isString
for technical reasons, the semantic type is actuallyint
.- Returns:
- a
String
- See Also:
-
getHost
The proxy host.- Returns:
- a
String
-
getNonProxyHosts
The list of non-proxied hosts (delimited by|
).- Returns:
- a
String
-
getLocation
Gets the location of the specified field in the input source.- Specified by:
getLocation
in interfaceInputLocationTracker
- Overrides:
getLocation
in classIdentifiableBase
-
getLocationKeys
Gets the keys of the locations of the input source.- Overrides:
getLocationKeys
in classIdentifiableBase
-
with
Creates a new builder with this object as the basis.- Overrides:
with
in classIdentifiableBase
- Returns:
- a
Builder
-
withId
Creates a newProxy
instance using the specified id.- Overrides:
withId
in classIdentifiableBase
- Parameters:
id
- the newString
to use- Returns:
- a
Proxy
with the specified id
-
withActiveString
Creates a newProxy
instance using the specified activeString.- Parameters:
activeString
- the newString
to use- Returns:
- a
Proxy
with the specified activeString
-
withProtocol
Creates a newProxy
instance using the specified protocol.- Parameters:
protocol
- the newString
to use- Returns:
- a
Proxy
with the specified protocol
-
withUsername
Creates a newProxy
instance using the specified username.- Parameters:
username
- the newString
to use- Returns:
- a
Proxy
with the specified username
-
withPassword
Creates a newProxy
instance using the specified password.- Parameters:
password
- the newString
to use- Returns:
- a
Proxy
with the specified password
-
withPortString
Creates a newProxy
instance using the specified portString.- Parameters:
portString
- the newString
to use- Returns:
- a
Proxy
with the specified portString
-
withHost
Creates a newProxy
instance using the specified host.- Parameters:
host
- the newString
to use- Returns:
- a
Proxy
with the specified host
-
withNonProxyHosts
Creates a newProxy
instance using the specified nonProxyHosts.- Parameters:
nonProxyHosts
- the newString
to use- Returns:
- a
Proxy
with the specified nonProxyHosts
-
newInstance
Creates a newProxy
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
Proxy
- See Also:
-
newInstance
Creates a newProxy
instance using default values or not. Equivalent tonewBuilder(withDefaults).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Proxy
-
newBuilder
Creates a newProxy
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newProxy
builder instance using default values or not.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newProxy
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theProxy
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newProxy
builder instance using the specified object as a basis.- Parameters:
from
- theProxy
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
isActive
public boolean isActive()Indicates if this proxy is active. To allow interpolation of this field, this method lazily parses thegetActiveString()
value as a boolean and defaults totrue
if not set.- Returns:
- a boolean indicating if this proxy is active
-
getPort
public int getPort()Returns the port to use for this proxy. To allow interpolation of this field, this method lazily parses thegetPortString()
value as an integer and defaults to8080
if not set.- Returns:
- an integer indicating the port to use for this proxy
-