All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.devonfw.tools.ide.migrator.line.StringReplaceLineMigration Maven / Gradle / Ivy

Go to download

Code for configurator the creates or updates configuration of IDEs (Eclipse, etc.).

There is a newer version: 3.0.0-beta25
Show newest version
package com.devonfw.tools.ide.migrator.line;

import java.io.FileFilter;

/**
 * Implementation of {@link LineMigration} for simple string replacement.
 */
public class StringReplaceLineMigration extends AbstractLineMigration {

  private final String search;

  private final String replacement;

  /**
   * The constructor.
   *
   * @param search the {@link String} to search for.
   * @param replacement the replacement for the {@code search} {@link String}.
   * @param fileFilter the {@link FileFilter} to accept the files that shall be migrated.
   */
  public StringReplaceLineMigration(String search, String replacement, FileFilter fileFilter) {

    super(fileFilter);
    this.search = search;
    this.replacement = replacement;
  }

  @Override
  protected String migrate(String line) {

    return line.replace(this.search, this.replacement);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy