Here you can find the source of copyProperties(Hashtable src, Hashtable target)
Parameter | Description |
---|---|
src | specifies the source hashtable from which properties should be copied. |
target | specifies the target hashtable to which properties should be copied. |
public static void copyProperties(Hashtable src, Hashtable target)
//package com.java2s; /*/*w ww . j a v a 2 s .c o m*/ * Copyright (c) Fiorano Software Pte. Ltd. and affiliates. All rights reserved. http://www.fiorano.com * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ import java.util.*; public class Main { /** * This API copies the properties from src hashtable to the target hashtable * * @param src specifies the source hashtable from which properties should be copied. * @param target specifies the target hashtable to which properties should be copied. */ public static void copyProperties(Hashtable src, Hashtable target) { // get all the keys of the source table. Enumeration keys = src.keys(); // put all the keys from the source to destination table while (keys.hasMoreElements()) { // get the next key Object key = keys.nextElement(); // get the value Object value = src.get(key); // put the value in the target table target.put(key, value); } } }