Package org.apache.maven.api.settings
Class Mirror
java.lang.Object
org.apache.maven.api.settings.TrackableBase
org.apache.maven.api.settings.IdentifiableBase
org.apache.maven.api.settings.Mirror
- All Implemented Interfaces:
Serializable
,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class Mirror
extends IdentifiableBase
implements Serializable, InputLocationTracker
A download mirror for a given repository.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create Mirror instances. -
Constructor Summary
ModifierConstructorDescriptionprotected
Mirror
(Mirror.Builder builder) Constructor for this class, to be called from its subclasses andMirror.Builder
. -
Method Summary
Modifier and TypeMethodDescriptionThe layout of the mirror repository.getLocation
(Object key) Gets the location of the specified field in the input source.Gets the keys of the locations of the input source.A repository id or (since Maven 2.0.9) an expression matching one or many repository ids to mirror, e.g.,central
or*,!repo1
.The layouts of repositories being mirrored.getName()
The optional name that describes the mirror.getUrl()
The URL of the mirror repository.boolean
Whether this mirror should be blocked from any download request but fail the download process, explaining why.static Mirror.Builder
Creates a newMirror
builder instance.static Mirror.Builder
newBuilder
(boolean withDefaults) Creates a newMirror
builder instance using default values or not.static Mirror.Builder
newBuilder
(Mirror from) Creates a newMirror
builder instance using the specified object as a basis.static Mirror.Builder
newBuilder
(Mirror from, boolean forceCopy) Creates a newMirror
builder instance using the specified object as a basis.static Mirror
Creates a newMirror
instance.static Mirror
newInstance
(boolean withDefaults) Creates a newMirror
instance using default values or not.toString()
with()
Creates a new builder with this object as the basis.withBlocked
(boolean blocked) Creates a newMirror
instance using the specified blocked.Creates a newMirror
instance using the specified id.withLayout
(String layout) Creates a newMirror
instance using the specified layout.withMirrorOf
(String mirrorOf) Creates a newMirror
instance using the specified mirrorOf.withMirrorOfLayouts
(String mirrorOfLayouts) Creates a newMirror
instance using the specified mirrorOfLayouts.Creates a newMirror
instance using the specified name.Creates a newMirror
instance using the specified url.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
-
Mirror
Constructor for this class, to be called from its subclasses andMirror.Builder
.- See Also:
-
-
Method Details
-
getMirrorOf
A repository id or (since Maven 2.0.9) an expression matching one or many repository ids to mirror, e.g.,central
or*,!repo1
.*
(since Maven 2.0.5),external:*
(since Maven 2.0.9) andexternal:http:*
(since Maven 3.8.0) have a special meaning: see Mirror Settings guide.- Returns:
- a
String
-
getName
The optional name that describes the mirror.- Returns:
- a
String
-
getUrl
The URL of the mirror repository.- Returns:
- a
String
-
getLayout
The layout of the mirror repository.- Returns:
- a
String
- Since:
- Maven 3.
-
getMirrorOfLayouts
The layouts of repositories being mirrored. This value can be used to restrict the usage of the mirror to repositories with a matching layout (apart from a matching id).- Returns:
- a
String
- Since:
- Maven 3.
-
isBlocked
public boolean isBlocked()Whether this mirror should be blocked from any download request but fail the download process, explaining why.
Default value is:false
Since: Maven 3.8.0- Returns:
- a
boolean
-
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 newMirror
instance using the specified id.- Overrides:
withId
in classIdentifiableBase
- Parameters:
id
- the newString
to use- Returns:
- a
Mirror
with the specified id
-
withMirrorOf
Creates a newMirror
instance using the specified mirrorOf.- Parameters:
mirrorOf
- the newString
to use- Returns:
- a
Mirror
with the specified mirrorOf
-
withName
Creates a newMirror
instance using the specified name.- Parameters:
name
- the newString
to use- Returns:
- a
Mirror
with the specified name
-
withUrl
Creates a newMirror
instance using the specified url.- Parameters:
url
- the newString
to use- Returns:
- a
Mirror
with the specified url
-
withLayout
Creates a newMirror
instance using the specified layout.- Parameters:
layout
- the newString
to use- Returns:
- a
Mirror
with the specified layout
-
withMirrorOfLayouts
Creates a newMirror
instance using the specified mirrorOfLayouts.- Parameters:
mirrorOfLayouts
- the newString
to use- Returns:
- a
Mirror
with the specified mirrorOfLayouts
-
withBlocked
Creates a newMirror
instance using the specified blocked.- Parameters:
blocked
- the newboolean
to use- Returns:
- a
Mirror
with the specified blocked
-
newInstance
Creates a newMirror
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
Mirror
- See Also:
-
newInstance
Creates a newMirror
instance using default values or not. Equivalent tonewBuilder(withDefaults).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Mirror
-
newBuilder
Creates a newMirror
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newMirror
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 newMirror
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theMirror
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newMirror
builder instance using the specified object as a basis.- Parameters:
from
- theMirror
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
toString
-