/** * @return a new {@link Builder} that allows creating a {@link PathConfig} * object. */ public static Builder builder() { return new Builder(); }
/** * @param paths * a {@link List} of {@link Path}s that match should be * matched for the {@link PathConfig}. * @return this builder instance. */ public Builder pathListMatcher(final List<Path> paths) { this.pathMatcher = DescribedPathMatcher.createPathListMatcher(paths); return this; }
/** * @return the new {@link PathConfig}. */ public PathConfig build() { return new PathConfig(this); } }
private String formatPathConfig(PathConfig config) { return " - " + config.getDescription() + " (type " + config.getTagArtifactType() + "): covers '" + config.getCoveredItemArtifactType() + "', prefix: '" + config.getCoveredItemNamePrefix() + "'"; }
public PathConfig convert() { return PathConfig.builder() // .coveredItemArtifactType(coveredItemArtifactType) .coveredItemNamePrefix(getItemNamePrefix()) // .tagArtifactType(tagArtifactType).pathListMatcher(getPaths()) // .build(); }
static DescribedPathMatcher createPathListMatcher(final List<Path> paths) { final ListBasedPathMatcher listMatcher = new ListBasedPathMatcher(new HashSet<>(paths)); return new DescribedPathMatcher(paths.toString(), listMatcher); }
@Override public String toString() { return getDescription(); }
private String getCoveredItemNamePrefix() { return this.pathConfig.getCoveredItemNamePrefix() != null ? this.pathConfig.getCoveredItemNamePrefix() : ""; }
/** * @param pattern * the pattern for the path, see * {@link FileSystem#getPathMatcher(String)} for supported * syntax. * @return this builder instance. */ public Builder patternPathMatcher(final String pattern) { this.pathMatcher = DescribedPathMatcher.createPatternMatcher(pattern); return this; }
static DescribedPathMatcher createPathListMatcher(final List<Path> paths) { final ListBasedPathMatcher listMatcher = new ListBasedPathMatcher(new HashSet<>(paths)); return new DescribedPathMatcher(paths.toString(), listMatcher); }
@Override public String toString() { return "PathConfig [pathMatcher='" + this.pathMatcher.getDescription() + "', coveredItemNamePrefix=" + this.coveredItemNamePrefix + ", coveredItemArtifactType=" + this.coveredItemArtifactType + ", tagArtifactType=" + this.tagArtifactType + "]"; }
private String getCoveredItemNamePrefix() { return this.pathConfig.getCoveredItemNamePrefix() != null ? this.pathConfig.getCoveredItemNamePrefix() : ""; }
/** * @return a new {@link Builder} that allows creating a {@link PathConfig} * object. */ public static Builder builder() { return new Builder(); }
/** * @param paths * a {@link List} of {@link Path}s that match should be * matched for the {@link PathConfig}. * @return this builder instance. */ public Builder pathListMatcher(final List<Path> paths) { this.pathMatcher = DescribedPathMatcher.createPathListMatcher(paths); return this; }
/** * @return the new {@link PathConfig}. */ public PathConfig build() { return new PathConfig(this); } }
/** * @param pattern * the pattern for the path, see * {@link FileSystem#getPathMatcher(String)} for supported * syntax. * @return this builder instance. */ public Builder patternPathMatcher(final String pattern) { this.pathMatcher = DescribedPathMatcher.createPatternMatcher(pattern); return this; }
@Override public String toString() { return "PathConfig [pathMatcher='" + this.pathMatcher.getDescription() + "', coveredItemNamePrefix=" + this.coveredItemNamePrefix + ", coveredItemArtifactType=" + this.coveredItemArtifactType + ", tagArtifactType=" + this.tagArtifactType + "]"; }
@Override public String toString() { return getDescription(); }
public String getDescription() { return this.pathMatcher.getDescription(); }
public String getDescription() { return this.pathMatcher.getDescription(); }