Skip to content

Commit

Permalink
configurable faking
Browse files Browse the repository at this point in the history
  • Loading branch information
Tcharl committed Jan 14, 2024
1 parent a9dd568 commit 4fe874b
Show file tree
Hide file tree
Showing 24 changed files with 765 additions and 552 deletions.
17 changes: 2 additions & 15 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions .idea/csv-editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package net.osgiliath.migrator.core.configuration;

/*-
* #%L
* data-migrator-core
* %%
* Copyright (C) 2024 Osgiliath Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/

import java.util.HashMap;
import java.util.Map;

public class ColumnTransformationDefinition {
private String columnName;

private Map<String, String> options = new HashMap<>();

public String getColumnName() {
return columnName;
}

public void setColumnName(String columnName) {
this.columnName = columnName;
}

public Map<String, String> getOptions() {
Map<String, String> ret = new HashMap<>();
for (Map.Entry<String, String> entry: options.entrySet()) {
String key = entry.getKey();
ret.put(key.replaceFirst("\\d+\\.", ""), entry.getValue());
}
return ret;
}

public void setOptions(Map<String, String> options) {
this.options = options;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class DataMigratorConfiguration {
/**
* List of sequencers being able to handle the sequence.
*/
private List<? extends TransformationConfigurationDefinition> sequencers;
private List<? extends SequencerDefinition> sequencers;

/**
* Graph datasource configuration.
Expand Down Expand Up @@ -103,15 +103,15 @@ public void setSequence(List<String> sequence) {
* List of sequencers being able to handle the sequence.
* @return the list of sequencers.
*/
public List<? extends TransformationConfigurationDefinition> getSequencers() {
public List<? extends SequencerDefinition> getSequencers() {
return sequencers;
}

/**
* List of sequencers being able to handle the sequence.
* @param sequencers the list of sequencers.
*/
public void setSequencers(List<? extends TransformationConfigurationDefinition> sequencers) {
public void setSequencers(List<? extends SequencerDefinition> sequencers) {
this.sequencers = sequencers;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* Configuration of the transformation sequences.
*/
public class TransformationConfigurationDefinition {
public class SequencerDefinition {
/**
* Name of the transformation sequencer.
*/
Expand All @@ -50,7 +50,7 @@ public class TransformationConfigurationDefinition {
/**
* Columns to be handled by the transformer.
*/
private Collection<String> columns = new HashSet<>();
private Collection<ColumnTransformationDefinition> columnTransformationDefinitions = new HashSet<>();

/**
* Get name of the sequencer to be referenced by the sequence.
Expand Down Expand Up @@ -118,15 +118,15 @@ public void setEntityClass(String entityClass) {
* Get the columns to be handled by the transformer.
* @return
*/
public Collection<String> getColumns() {
return columns;
public Collection<ColumnTransformationDefinition> getColumnTransformationDefinitions() {
return columnTransformationDefinitions;
}

/**
* Set the columns to be handled by the transformer.
* @param columns the columns to be handled by the transformer.
* @param columnTransformationDefinitions the columns to be handled by the transformer.
*/
public void setColumns(Collection<String> columns) {
this.columns = columns;
public void setColumnTransformationDefinitions(Collection<ColumnTransformationDefinition> columnTransformationDefinitions) {
this.columnTransformationDefinitions = columnTransformationDefinitions;
}
}
Loading

0 comments on commit 4fe874b

Please sign in to comment.