Java AbstractMap Usage getSymmetricPropertyValueDifference( Properties propertyFileOne, Properties propertyFileTwo)

Here you can find the source of getSymmetricPropertyValueDifference( Properties propertyFileOne, Properties propertyFileTwo)

Description

get Symmetric Property Value Difference

License

Apache License

Declaration

public static Map<String, SimpleEntry<String, String>> getSymmetricPropertyValueDifference(
            Properties propertyFileOne, Properties propertyFileTwo) 

Method Source Code


//package com.java2s;
/*/*from ww w . j  a  v a2  s  .  c  om*/
 *  Inspired by the Commons Collections package created by Apache
 *  http://commons.apache.org/collections/
 *  http://www.apache.org/licenses/LICENSE-2.0
 */

import java.util.*;
import static java.util.AbstractMap.*;

public class Main {
    public static Map<String, SimpleEntry<String, String>> getSymmetricPropertyValueDifference(
            Properties propertyFileOne, Properties propertyFileTwo) {
        Map<String, SimpleEntry<String, String>> differences = new HashMap<String, SimpleEntry<String, String>>();

        for (String key : propertyFileOne.stringPropertyNames()) {
            String propertyOneValue = propertyFileOne.getProperty(key);
            String propertyTwoValue = propertyFileTwo.getProperty(key);
            if (propertyOneValue != null && propertyTwoValue != null
                    && !propertyOneValue.equals(propertyTwoValue)) {
                differences.put(key, new SimpleEntry(propertyOneValue, propertyTwoValue));
            }
        }

        return differences;
    }
}

Related

  1. buildClause(String key, String... values)
  2. countLinesColumns(String text, int initialLinesCnt, int initialColumnsCnt)
  3. decodeIconUrl(String path)
  4. getClassType(Object obj)
  5. parseEntityURI(final String uri)
  6. parseExportedVariable(String exportedVariable)
  7. parseSocketAddress(String address)
  8. parseVariableName(String variableName)