@Test public void testCloneActions() { List<Action> actionsList = Arrays.asList(new Camelize(), new Capitalize(), new CurrentDate(), new CurrentDateTime(), new CurrentTime(), new CustomAction(), new GenerateUUID(), new Lowercase(), new LowercaseChar(), new PadStringLeft(), new PadStringRight(), new SeparateByDash(), new SeparateByUnderscore(), new Length(), new SubString(), new SubStringAfter(), new SubStringBefore(), new Trim(), new TrimLeft(), new TrimRight(), new Uppercase(), new UppercaseChar()); ArrayList<Action> actions = new ArrayList<Action>(); actions.addAll(actionsList); ArrayList<Action> clones = AtlasModelFactory.cloneFieldActions(actions); assertNotNull(clones); assertNotSame(actions, clones); }
public static ArrayList<Action> cloneFieldActions(ArrayList<Action> actions) { if (actions == null) { return null; } ArrayList<Action> n = new ArrayList<Action>(); if (actions == null || actions.isEmpty()) { return n; } for (Action a : actions) { n.add(cloneAction(a)); } return n; }
AtlasModelFactory { public static ArrayList<Action> cloneFieldActions(ArrayList<Action> actions) { if (actions == null) { return null; } ArrayList<Action> n = new ArrayList<Action>(); if (actions == null || actions.isEmpty()) { return n; } for (Action a : actions) { n.add(cloneAction(a)); } return n; } }
AtlasModelFactory { public static ArrayList<Action> cloneFieldActions(ArrayList<Action> actions) { if (actions == null) { return null; } ArrayList<Action> n = new ArrayList<Action>(); if (actions == null || actions.isEmpty()) { return n; } for (Action a : actions) { n.add(cloneAction(a)); } return n; } private  AtlasModelFactory(); }
AtlasModelFactory { public static ArrayList<Action> cloneFieldActions(ArrayList<Action> actions) { if (actions == null) { return null; } ArrayList<Action> n = new ArrayList<Action>(); if (actions == null || actions.isEmpty()) { return n; } for (Action a : actions) { n.add(cloneAction(a)); } return n; } private  AtlasModelFactory(); @SuppressWarnings("unchecked") static T createMapping(MappingType type); static AtlasMapping createAtlasMapping(); static Collection createCollection(); static MockDocument createMockDocument(); static MockField createMockField(); static PropertyField createPropertyField(); static BaseMapping cloneMapping(BaseMapping baseMapping, boolean deepClone); static Field cloneField(Field f); static FieldGroup copyFieldGroup(FieldGroup fg); static SimpleField cloneFieldToSimpleField(Field field); static void copyField(Field from, Field to, boolean withActions); static FieldGroup createFieldGroupFrom(Field field, boolean withActions); static ArrayList<Action> cloneFieldActions(ArrayList<Action> actions); static Action cloneAction(Action action); static String toString(PropertyField f); static String toString(Field f); static Field wrapWithField(Object val); static Field wrapWithField(Object val, String parentPath); static Object unwrapField(Field f); }
AtlasModelFactory { public static ArrayList<Action> cloneFieldActions(ArrayList<Action> actions) { if (actions == null) { return null; } ArrayList<Action> n = new ArrayList<Action>(); if (actions == null || actions.isEmpty()) { return n; } for (Action a : actions) { n.add(cloneAction(a)); } return n; } private  AtlasModelFactory(); @SuppressWarnings("unchecked") static T createMapping(MappingType type); static AtlasMapping createAtlasMapping(); static Collection createCollection(); static MockDocument createMockDocument(); static MockField createMockField(); static PropertyField createPropertyField(); static BaseMapping cloneMapping(BaseMapping baseMapping, boolean deepClone); static Field cloneField(Field f); static FieldGroup copyFieldGroup(FieldGroup fg); static SimpleField cloneFieldToSimpleField(Field field); static void copyField(Field from, Field to, boolean withActions); static FieldGroup createFieldGroupFrom(Field field, boolean withActions); static ArrayList<Action> cloneFieldActions(ArrayList<Action> actions); static Action cloneAction(Action action); static String toString(PropertyField f); static String toString(Field f); static Field wrapWithField(Object val); static Field wrapWithField(Object val, String parentPath); static Object unwrapField(Field f); static final String GENERATED_PATH; }