public class MavenFormatStageImpl extends Object implements MavenFormatStage
MavenFormatStage| Constructor and Description |
|---|
MavenFormatStageImpl(Collection<MavenResolvedArtifact> artifacts) |
| Modifier and Type | Method and Description |
|---|---|
<RETURNTYPE> |
as(Class<RETURNTYPE> returnTypeClass)
Formats the resultant artifacts as an array of
types. |
File[] |
asFile()
Formats the resultant artifacts as an array of
Files |
InputStream[] |
asInputStream()
Formats the resultant artifacts as an array of
InputStreams. |
<RETURNTYPE> |
asList(Class<RETURNTYPE> returnTypeClass)
Formats the resultant artifacts as a list of
types. |
MavenResolvedArtifact[] |
asResolvedArtifact()
Formats the resultant artifacts as an array of
RESOLVEDTYPE. |
<RETURNTYPE> |
asSingle(Class<RETURNTYPE> type)
Formats the resultant artifact as a
type; assumes a single artifact is returned from resolution. |
File |
asSingleFile()
Formats the resultant artifact as a
File; assumes a single artifact is returned from resolution. |
InputStream |
asSingleInputStream()
Formats the resultant artifact as an
InputStream; assumes a single artifact is returned from resolution. |
MavenResolvedArtifact |
asSingleResolvedArtifact()
Formats the resultant artifact as
RESOLVEDTYPE; assumes a single artifact is returned from resolution. |
public MavenFormatStageImpl(Collection<MavenResolvedArtifact> artifacts)
public File[] asFile()
FormatStageFilesasFile in interface FormatStage<MavenResolvedArtifact>Filespublic File asSingleFile() throws NonUniqueResultException, NoResolvedResultException
FormatStageFile; assumes a single artifact is returned from resolution.asSingleFile in interface FormatStage<MavenResolvedArtifact>FileNonUniqueResultException - If the resolution resulted in more than one resultNoResolvedResultException - If the resolution did not yield any resultpublic InputStream[] asInputStream()
FormatStageInputStreams. It is a caller responsibility to close the streams
afterwards.asInputStream in interface FormatStage<MavenResolvedArtifact>InputStreams.public InputStream asSingleInputStream() throws NonUniqueResultException, NoResolvedResultException
FormatStageInputStream; assumes a single artifact is returned from resolution. It is a
caller responsibility to close the stream afterwards.asSingleInputStream in interface FormatStage<MavenResolvedArtifact>InputStream.NonUniqueResultException - If the resolution resulted in more than one resultNoResolvedResultException - If the resolution did not yield any resultpublic MavenResolvedArtifact[] asResolvedArtifact()
FormatStageRESOLVEDTYPE.asResolvedArtifact in interface FormatStage<MavenResolvedArtifact>RESOLVEDTYPE.public MavenResolvedArtifact asSingleResolvedArtifact() throws NonUniqueResultException, NoResolvedResultException
FormatStageRESOLVEDTYPE; assumes a single artifact is returned from resolution.asSingleResolvedArtifact in interface FormatStage<MavenResolvedArtifact>RESOLVEDTYPE.NonUniqueResultException - If the resolution resulted in more than one resultNoResolvedResultException - If the resolution did not yield any resultpublic <RETURNTYPE> RETURNTYPE[] as(Class<RETURNTYPE> returnTypeClass) throws IllegalArgumentException, UnsupportedOperationException
FormatStagetypes. If nothing matches resolution, an empty array will
be returned. Supports extensible formats by registering a FormatProcessor for given returnTypeClass.as in interface FormatStage<MavenResolvedArtifact>RETURNTYPE - The return typereturnTypeClass - The return type classtypes.IllegalArgumentException - If the type is not specifiedUnsupportedOperationException - If the type is not supported *public <RETURNTYPE> List<RETURNTYPE> asList(Class<RETURNTYPE> returnTypeClass) throws IllegalArgumentException, UnsupportedOperationException
FormatStagetypes. If nothing matches resolution, an empty list will
be returned. Supports extensible formats by registering a FormatProcessor for given returnTypeClass.asList in interface FormatStage<MavenResolvedArtifact>RETURNTYPE - The return typereturnTypeClass - The return type classtypes.IllegalArgumentException - If the type is not specifiedUnsupportedOperationException - If the type is not supported *public <RETURNTYPE> RETURNTYPE asSingle(Class<RETURNTYPE> type) throws IllegalArgumentException, UnsupportedOperationException, NonUniqueResultException, NoResolvedResultException
FormatStagetype; assumes a single artifact is returned from resolution.
Supports extensible formats by registering a FormatProcessor for given returnTypeClass.asSingle in interface FormatStage<MavenResolvedArtifact>RETURNTYPE - The return typetype - The return type classtype.IllegalArgumentException - If the type is not specifiedUnsupportedOperationException - If the type is not supportedNonUniqueResultException - If the resolution resulted in more than one resultNoResolvedResultException - If the resolution did not yield any resultCopyright © 2024 JBoss by Red Hat. All rights reserved.